How To Change Nav Bar Item Hover

by Matt on June 22, 2009

What is a hover? Hover is a pseudo-class of CSS. Pseudo-classes allow some selectors to have special effects. A pseudo class, in this case hover, looks like this: :hover. Notice the colon. I will explain more about CSS in later posts, so for now let’s change the hover function in your Thesis customization.

By default, Thesis’ nav item hover is an underline. I don’t personally care for underlines (only in certain contexts), but Chris Pearson decided that Thesis nav items should behave like that by default. He knows his stuff. But, if you’re stubborn like me, you still want to change it.

Let’s change the hover:

  1. Open custom.css.
  2. Enter the following:
    .custom #tabs a:hover { background: #color hex here; text-decoration: none }

In this very simple example, we changed the background color and took away the underline. What are other options? You could change the text color by adding color: #color hex here;, change the top, right, bottom or left border with border-top: #color hex here 1px solid; [replace top with another side name] or a whole host of other changes. One of my absolute favorites is the following:

.custom #tabs { border-left: none; border-bottom: none; }
.custom  #tabs li { border-top: none; border-right: none; }
    .cusotm #tabs a:hover { background: #d9d9d9; margin-top: -.2em; }

Just, uh, don’t forget the decimal or you will really piss people off.

Oh, and don’t forget to submit ALL your questions to thesistutor[at]gmail[dot]com.

{ 4 comments… read them below or add one }

Ridgely June 22, 2009 at 2:04 pm

Solid tutorial except it would be extra awesome if you provided “after” photos/screenshots of your special effect so we could know if that might be something we’d like to try. Any chance also of a tutorial on rounded corner nav tabs?

Reply

Matt June 22, 2009 at 2:08 pm

I just haven’t gotten my recording set up yet. I will soon be showing EVERYTHING in video format. As far as the rounded corners, I’ll have one up there for ya today. Check back and thanks for reading!

Reply

WordPress Search Engine April 16, 2010 at 11:46 am

I’m thinking that I can use the onHover to create a mouseOver image for buttons with a Nav menu background image (normal buttons in background) to create an image based nav menu for Thesis…. but I’m guessing there is a much easier way but I just can’t seem to find any tutorials on the subject.

Do you have any tutorials for that? Are you planning on developing any for image based Thesis Nav Menus?

Reply

Chris June 8, 2010 at 10:07 pm

It would be great if you came up with a tutorial for image based nav menus , if there is enough demand. I tried paying with the nav menu on my site and as you can see that hasn’t gone to0 well

Reply

Leave a Comment

Previous post:

Next post: