开发者

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

开发者 https://www.devze.com 2023-03-12 04:58 出处:网络
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

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

精彩评论

暂无评论...
验证码 换一张
取 消