Anyways, I'd like to make all anchors none underlined so I have tried the following:
Code: Select all
li>a {
text-decoration: none
}
li#a {
text-decoration: none
}Moderator: General Moderators
Code: Select all
li>a {
text-decoration: none
}
li#a {
text-decoration: none
}Code: Select all
li a {
/**
* CSS Data
**/
}Code: Select all
li>a { text-decoration: none; }Code: Select all
li#a { text-decoration: none; }Code: Select all
li a { text-decoration: none; }Kieran Huggins wrote:Beware child selectors: they don't work properly in IE6.
Your first example means "all <a/> elements that are the direct children of <li/> elements" (works, but IE chokes on the '>' selector)Your second example means "all <li/> elements that have the exact id a "Code: Select all
li>a { text-decoration: none; }R4000's solution is correct, as it will match "all <a/> elements that are descendants at any level of a <li/> element"Code: Select all
li#a { text-decoration: none; }Be mindful of that last distinction, though I doubt it would be a problem for you very often.Code: Select all
li a { text-decoration: none; }
Code: Select all
li>a { text-decoration: none; }Code: Select all
<ul>
<li><a href="#">THIS ONE MATCHES</a></li>
<li><a href="#">SO DOES THIS ONE</a></li>
<li><span><a href="#">THIS ONE WONT MATCH</a></span></li> <!-- not a direct child of <li/> -->
</ul>Code: Select all
li#a { text-decoration: none; }Code: Select all
<ul>
<li id="a">THIS GETS MATCHED</li>
<li>NOT THIS ONE THOUGH</li>
</ul>Code: Select all
li a { text-decoration: none; }Code: Select all
<ul>
<li><a href="#">THIS ONE MATCHES</a></li>
<li><a href="#">SO DOES THIS ONE</a></li>
<li><span><a href="#">THIS WILL MATCH</a></span></li>
</ul>