开发者

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜