0

到目前为止它只响应悬停,不知道为什么它不响应活动

这是小提琴http://jsfiddle.net/tP9E9/1/

CSS:

.menu ul li button:hover {
    background-color: rgba(206,0,0,1);
}

.menu ul li button:active {
    background-color: rgba(206,0,0,1);
}

您可能已经猜到了,我有几个 div,其中包含各种内容,可以响应按钮点击而打开。悬停工作正常,但是当与按钮对应的 div 打开(活动)时,按钮不会变红。这是为什么?

谢谢

4

1 回答 1

3

利用

<input type="button" value="news">

和CSS

input:hover {
    background-color: green;
}
input:active {
    background-color: yellow;
}

您还可以添加:focus将在选项卡上可用。

提琴手

于 2013-02-12T10:26:28.960 回答