Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialnvcxnvkldsjaklfds
Courses Plus Student 5,041 PointsUse classes in CSS
<ul>
<!--anchor element is a child to list element here.-->
<li><a href="index.html" class="select">Projects</a></li>
<a href="about.html" class="select"><li>About</li></a>
<li><a href="contact.html" class="select">Contact</a></li>
<ul>
nav a.select, nav a:hover{
color: #32673f;
}
I do not understand this bit. Can anyone here explain me please?
Thanks in advance,
Regards,
Karthikeyan P
2 Answers
geoffrey
28,736 PointsYou are totally right, try to apply another color such as #FFF as exemple, when mouse is hovering anchors. Then in this case the color will switch to #32673f to #FFF. You got it ! :)
geoffrey
28,736 PointsYou apply the color #32673f to all anchors nested inside nav tags where there is the "select" class applied then you have a comma and another selector, that simply means you'll apply the same rule to the other selector, which is here nav a:hover.
In this case, when your mouse is hovering all anchors nested inside nav tags.
nav a.select, nav a:hover{
color: #32673f;
}
/*It's the same as, this, but we should avoid to repeat*/
nav a.select{
color: #32673f;
}
nav a:hover{
color: #32673f;
}
nvcxnvkldsjaklfds
Courses Plus Student 5,041 PointsIn HTML, I have added classes to all anchor elements inside nav element with class name "select".
In CSS, I applied color property and value to #32673f to "select" class name and hover state on anchor element inside nav.
Simply there will no change right in this case. right?