exceptions/conditions in classes
How can you make conditions in classes?
tr.list_row2:hover > td > div {
/* proporties */
}
How can you make an exception for tr.list_row2:hover > td > div.test
? The class doesn't have to be added if the element has t开发者_如何转开发he class div.test
Use CSS3's :not()
:
tr.list_row2:hover > td > div:not(.test) {
}
or for old IEs which don't recognize it,
tr.list_row2:hover > td > div {
}
tr.list_row2:hover > td > div.test {
/* undo above rules */
}
精彩评论