2012-06-26 36 views
0

当我将鼠标悬停在整个按钮上时,我希望它显示在整个按钮上。由于该按钮具有背景图像,因此我无法正确执行此操作。该按钮看起来像这些:如何将鼠标悬停在整个按钮上

enter image description here

的CSS似乎是这样的:

#tablist{ 
    padding: 0px auto 0px auto; 
    height: 32px; 
} 

#tablist li{ 
    display: block; 
    width: 150px; 
    height: 35px; 
    float: left; 
    border-radius: 7px; 
    -moz-border-radius: 7px; 
    -webkit-border-radius: 7px; 
    margin: 0px auto 0px auto; 
    text-align: center; 
    padding-top: 5px; 
    cursor: hand; 
    cursor: pointer; 
} 

#tablist ul:hover{ 
background-color: red; 
} 

.tablink{ 
    text-decoration:none; 
} 

.locked{ 
    background: url('../img/DashboardButtonsLocked.png') no-repeat; 
    background-position:5px -85px; 
} 
.unlocked{ 
    background: url('../img/DashboardButtonsLocked.png') no-repeat; 
    background-position:4px -2px; 
} 

如何纠正呢?需要一些指导。

+4

你究竟想干什么?...... –

+0

添加js小提琴来演示这个问题。我不知道你需要什么帮助。 – iambriansreed

+0

问题是图像阻挡了悬停发生。 @gabitzish答案解决了它... – lakesh

回答

1

嘿,我想你应该给#tablist li:hover

由于这样

#tablist li:hover{ 
background-color: red; 
} 
相关问题