-2

Possible Duplicate:
What does “>” mean in CSS rules?

what's the use of > in css? like this ul li:hover > ul or ul li > li. >_<, i'm still new to web dev. can tell me when and how to use this >? and what does it call? like uh greater than? lol im sorry im really new.

#navMenu li > ul
{
    display:none;
    position:absolute;
}

#navMenu li:hover > ul
{
    display:block;
    width:100px;
}

#navMenu li > ul li > ul
{
    left:100%;
    top:0;
    width:100px;
}
Community
  • 1
  • 1
FishBowlGuy
  • 939
  • 2
  • 8
  • 10
  • This and many other selectors are listed here in a neat DIY article: https://code.tutsplus.com/tutorials/the-30-css-selectors-you-must-memorize--net-16048 – Ashwin Prabhu Feb 08 '18 at 11:30

2 Answers2

4

Child & Descendant Selector!

In simple words, the > character selects the immediate child and applies the styles.

For more information, take a look at Child and Sibling Selectors

Community
  • 1
  • 1
Praveen Kumar Purushothaman
  • 164,888
  • 24
  • 203
  • 252
2

It's immediate children selector. Introduced in CSS 2.1.

You can find out more in this question: What does the ">" (greater-than sign) CSS selector mean?

Community
  • 1
  • 1
Josip Filipović
  • 148
  • 1
  • 1
  • 8