如何为HTML选择选项悬停和选择的选项效果设置样式 [英] How to style HTML select option hover and selected option effects

查看:208
本文介绍了如何为HTML选择选项悬停和选择的选项效果设置样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试删除HTML选择选项悬停效果上的默认蓝色背景,并使用下面的CSS块设置所选选项效果的样式,但似乎无法正常工作.蚂蚁关于如何实现这一点的想法.

I'm trying to remove the default blue background on the HTML select option hover effect and also style the selected option effects with the block of CSS below but it doesn't seem to be working. Ant ideas on how this can be achieved.

    select.color-chooser option:hover {
        background-color: none!important;

    }

select.color-chooser option[selected] {
        background-color: none!important;

    }

推荐答案

如果您希望使用jQuery Chosen或类似的

You can't do this, if you want you can use jQuery Chosen or similar http://harvesthq.github.io/chosen/

它生成易于样式化的HTML列表.

It generates HTML lists easy to style.

这篇关于如何为HTML选择选项悬停和选择的选项效果设置样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆