CSS3 element1 ~ element2 selector
CSS selectors complete reference manual
Examples
Set the background color p elements under the same parent element after each ul element:
p~ul
{
background:#ff0000;
}
{
background:#ff0000;
}
try it"
Definition and Usage
element1~ element2 selector matches appear element1 back element2.
element1andelement2these two elements must have the same parent element, butelement2need not immediately behind theelement1.
Browser Support
All major browsers supportelement1~ element2 selector.
Note: To use IE8 and earlier versions of this choice, you must declare <DOCTYPE!> .