Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does ">" mean in CSS? [duplicate]

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

What does the > symbol mean in CSS? I noticed it in my Wordpress blog theme and want to know what it is doing.

#access li:hover > a, #access ul ul :hover > a, #access a:focus {     background: #efefef; } #access li:hover > a, #access a:focus {     background: #f9f9f9; /* Show a solid color for older browsers */     background: -moz-linear-gradient(#f9f9f9, #e5e5e5);     background: -o-linear-gradient(#f9f9f9, #e5e5e5);     background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#f9f9f9), to(#e5e5e5)); /* Older webkit syntax */     background: -webkit-linear-gradient(#f9f9f9, #e5e5e5);     color: #373737; } #access ul li:hover > ul {     display: block; } 
like image 318
Duke Programmer Avatar asked Feb 28 '12 18:02

Duke Programmer


1 Answers

it means that only "first nested" elements will be targeted ("child" elements), for example

   <div id="a">        <div id="b">          <div id="c">        </div>       </div>     </div> 

if you write

#a div{  background: red; } 

then both #b and #c will be red, but if you use > like

#a > div{  background: red; } 

then only #b will be red, #c will not.

like image 79
mkk Avatar answered Oct 01 '22 10:10

mkk