gpt4 book ai didi

html - 让

转载 作者:太空宇宙 更新时间:2023-11-04 00:06:06 24 4
gpt4 key购买 nike

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

这是 fiddle 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 时,按钮不会变红。这是为什么?

谢谢

最佳答案

使用

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

和CSS

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

您还可以添加 :focus,它将在 Tab 上可用。

JsFiddle

关于html - 让 <button> 响应 :active, 是否有可能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14829610/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com