如果通过css已经具有活动状态,如何防止悬停按钮,div,li?
#list-of-tests .item-test:hover {
background-color: #4d5f75;
border: solid 1px #4d5f75;
}
#list-of-tests .item-test:active {
background-color: #93c3cd;
border: solid 1px #93c3cd;
}
答案 0 :(得分:3)
两种方式:
1)对!important
州使用:active
:
#list-of-tests .item-test:active {
background-color: #93c3cd !important;
border: solid 1px #93c3cd !important;
}
2)指定多个状态:
#list-of-tests .item-test:active,
#list-of-tests .item-test:active:hover {
background-color: #93c3cd;
border: solid 1px #93c3cd;
}