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 trial

HTML How to Make a Website Styling Web Pages and Navigation Build Navigation with Unordered Lists

Michael Baron
Michael Baron
1,453 Points

Hover highlight

hey guys.how do i make a my navigation get highlighted whenever i hover around it?

2 Answers

Trevor Johnson
Trevor Johnson
14,427 Points

Hey 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.

Michael Baron
Michael Baron
1,453 Points

thanks you saved my code, its perfect now

Steven Parker
Steven Parker
231,269 Points

It 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;
}