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 trialMichael Baron
1,453 PointsHover highlight
hey guys.how do i make a my navigation get highlighted whenever i hover around it?
2 Answers
Trevor Johnson
14,427 PointsHey there, you would use css to get that done. If it's the nav tag then write it out like this:
nav: hover {
//What you want it to do on hover
}
Or if you have an id name for it then select it by that and then add the : hover after it.
Steven Parker
231,275 PointsIt depends on how you want to "highlight" it, and what the structure looks like.
But for example, let's assume your navigation is based on items in an unordered list in a <nav>
element. And you'd like the text of the item hovered over to become bold and red. You could add some CSS like this:
nav li:hover {
color: red;
font-weight: bold;
}
Michael Baron
1,453 Pointsthanks its perfect now
Michael Baron
1,453 PointsMichael Baron
1,453 Pointsthanks you saved my code, its perfect now