gpt4 book ai didi

html - 在 html 中悬停时更改选择列表选项背景颜色

转载 作者:技术小花猫 更新时间:2023-10-29 11:44:41 28 4
gpt4 key购买 nike

<分区>

悬停时是否可以更改选择列表选项的默认背景颜色?

HTML:

<select id="select">
<option value="1">One</option>
<option value="2">Two</option>
<option value="3">Three</option>
</select>
select {
-webkit-border-radius:25px; -moz-border-radius:25px; border-radius:25px;
}

select:hover {
background-color:gren;
}

option:hover {
background-color:yellow;
}

option {
-webkit-border-radius:25px; -moz-border-radius:25px; border-radius:25px;
color:blue;
background-color:yellow;
}

我试过选项 :hover{background-color:red;},但没用。有人知道怎么做吗?

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