如果通过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;
}
如果通过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;
}
两种方式:
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;
}