Home > Web Front-end > HTML Tutorial > select option背景颜色问题_html/css_WEB-ITnose

select option背景颜色问题_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:22:54
Original
2545 people have browsed it

我想问一下 我想给一个select元素里的option 在鼠标悬浮的时候改变它的 背景颜色和字体颜色 我select>option:hover{}这样没有效果 为什么呢 该怎么写才对呢?


回复讨论(解决方案)

option的:hover样式是浏览器系统默认且固定的,用户无法修改

你只能做个模拟的select

option的:hover样式是浏览器系统默认且固定的,用户无法修改
网上很多模拟select写的 div+ul 你可以看看

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template