-1
    .main-navigation ul li.menu-item-has-children:hover~li {
    opacity: 0;
}

Taken from my WordPress theme. What is the meaning of ~li (with the ~ character)?

Thank You

Eae
  • 4,191
  • 15
  • 55
  • 92

1 Answers1

0

The pre ~ p selector means "each P element that is preceded by a PRE element", but, unlike the pre + p adjacent selector, the element doesn't have to be the direct preceding element.

Therefore this paragraph, too, should be red. Although it's not directly preceded by a , the is a general previous sibling.

This is a paragraph in a div. Since this paragraph doesn't have the as a previous sibling (it's more like an uncle; a previous sibling of this paragraph's parent node), it shouldn't be red.

Thijs Kempers
  • 459
  • 6
  • 17
  • 2
    Copied directly from http://quirksmode.org/css/selectors/selector_sibling.html. You shouldn't plagiarise other people's content and call it your own. You should place a link to where you took your information from. – Madara's Ghost Oct 30 '14 at 08:54