Is there any CSS selector to reach an element outside of the current container?
- by acidrums4
(And excuse me for my bad english, for starters...)
Sorry if this is a noob question, but I really don't know if the following is possible. I'm doing a html5 portfolio. I'm following a tuto from codrops to visually filter works with only css3 (http://tympanus.net/codrops/2012/01/09/filter-functionality-with-css3/). There, user can select which category want to see with some <input type="radio">'s. But those selectors are under the same container (a <section>) and give visibility for the elements via CSS using a general sibling combinator (~). So in that example, the CSS code goes like this:
.ff-container input.ff-selector-type-all:checked ~ label.ff-label-type-all,
.ff-container input.ff-selector-type-1:checked ~ label.ff-label-type-1,
.ff-container input.ff-selector-type-2:checked ~ label.ff-label-type-2,
.ff-container input.ff-selector-type-3:checked ~ label.ff-label-type-3{
background: linear-gradient(top, #646d93 0%,#7c87ad 100%);
color: #424d71;
text-shadow: 0px 1px 1px rgba(255,255,255,0.3);
box-shadow:
0px 0px 0px 1px #40496e,
0 1px 2px rgba(0,0,0,0.1) inset;
}
The thing is I want to put those <input type="radio">'s on the <head> section of my portfolio, but obviously the ~ selector won't work there. So my question is that is there any selector, hack or something that can do that? Something like
.ff-container input.ff-selector-type-all:checked $ header > label.ff-label-type-all { awesomeness:100%; }
I really don't want to use Javascript/Jquery for that... Thank you so much in advance!