tnw
tnw

Reputation: 13877

CSS/HTML Question: Background on hover and on current page

I'm trying to get my page to have a background on my links when I hover over them as well as when the links are the current, active page (kinda like the way dribbble.com does it). I use PHP to check if the current page matches the link to assign an ID, "tab" to my links when they are the current page. Here is my CSS.

#tab {
    background: url('../images/underline.gif') no-repeat;
    color: #000;
}
#filter a:hover { url('../images/underline.gif') no-repeat;}

The background will show up properly when it is the current page, but will not show up on mouse-over. Any ideas why that would be?

Upvotes: 2

Views: 249

Answers (2)

js1568
js1568

Reputation: 7032

#tab {
    background: url('../images/underline.gif') no-repeat;
    color: #000;
}
#filter a:hover { 
    background:url('../images/underline.gif') no-repeat;
}

Your code is missing the background:

Upvotes: 3

dotty
dotty

Reputation: 41433

Shouldn't that be

#tab {
background: url('../images/underline.gif') no-repeat;
color: #000;
}
#tab:hover { url('../images/underline.gif') no-repeat;}

Upvotes: 0

Related Questions