I have following HTML structure:
Candy jelly-o jelly beans gummies lollipop
Cupcake ipsum dolor sit amet.
The rule h2~ul will not select h2 but ul. So you will not be able to apply any style to h2.
CSS element1~element2
I have the same problem with panel location. I have a element that is followed by a . And in this case I would like to reduce the height or the min-height (depends on the panels are fixed or not) of the main panel by style application.
In case of fixed footer, because I can declare the element before the main in my html file (it will be relocated by top/left properties) I can use the ~ selector like this: footer ~ main. But in case of non fixed footer, the only way I found is to add a class at document.ready() call.