html select 控件选中后内容变成红色
如图:
可能原因:
- 使用了框架,框架里面的样式导致了这个问题
解决方法:
- 在该select存在的文件中重新写样式,但要使用“!important”来强制使用重写的样式
select {
color: inherit !important;
}
select option {
color: inherit !important;
}
select option:checked {
color: inherit !important;
}

当HTML select控件选中后,内容默认显示为红色。问题可能由框架样式引起。解决办法是在当前文件中覆盖select样式,并使用'!important'确保样式优先级。
1821

被折叠的 条评论
为什么被折叠?



