开发者

exceptions/conditions in classes

开发者 https://www.devze.com 2023-03-31 14:33 出处:网络
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

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 */
}
0

精彩评论

暂无评论...
验证码 换一张
取 消