js 操作 dom 后,css hover失效
解决方案:加上 !important
示例:
.button-list > button:hover{
background: rgba(4, 81, 148, 0.33) !important;
color: #80DFF6 !important;
}
原因
js优先权高于css,所以使用js操作dom后css会失效。!important,作用是提高指定样式规则的应用优先权(优先级)。
!important 使该条样式属性声明具有最高优先级

浙公网安备 33010602011771号