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开发者_Python百科 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?
#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:
Shouldn't that be
#tab {
background: url('../images/underline.gif') no-repeat;
color: #000;
}
#tab:hover { url('../images/underline.gif') no-repeat;}
精彩评论