Issue
<nav>
<a href="#">HOME</a>
<a href="#">SPEAKERS</a>
<a href="#">SCHEDULE</a>
<a href="#">VENUE</a>
<a href="#">REGISTER</a>
</nav>
when i target the 'nav' element in CSS, I am able to change properties such as the font-size/font-weight/letter-spacing of the content of the 'a' element. However, I cannot change the text color. In order to do so, I have to target 'nav a'.
Why am I able to target some typographical properties when specifying just 'nav' but not others?
Solution
The child tag does not inherit the style of a parent, when it has tis own style.
a
tag has a default style:
a: -webkit-any-link {
color: -webkit-link;
cursor: pointer;
text-decoration: underline;
}
Therefore, you should use more specific the selector
Answered By - MefAldemisov
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.