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; }
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With