我有以下三种CSS样式:

.post-entry > blockquote {
    display: block;
    background-color: #eee;
    padding: 20px;
    border-left: 10px solid #0e65b6;
    margin-top: 10px;
    margin-bottom:15px;
    font-size:1.3em;
}
.post-entry > blockquote:before {
    content:"\201C";
    font-size: 4em;
    line-height: 0.1em;
    margin-right: 0.25em;
    vertical-align: -0.4em;
}
.post-entry > blockquote p {
  display: inline;
}


我想排除它们出现在<blockquote class="tweet">上。

如何正确选择每个选择器上的“非”选择器?

谢谢,

克里斯。

最佳答案

由于blockquote元素具有类tweet,因此应使用blockquote:not(.tweet)

Example Here

.post-entry > blockquote:not(.tweet) {
    display: block;
    background-color: #eee;
    padding: 20px;
    border-left: 10px solid #0e65b6;
    margin-top: 10px;
    margin-bottom:15px;
    font-size:1.3em;
}
.post-entry > blockquote:not(.tweet):before {
    content:"\201C";
    font-size: 4em;
    line-height: 0.1em;
    margin-right: 0.25em;
    vertical-align: -0.4em;
}
.post-entry > blockquote:not(.tweet) p {
  display: inline;
}

关于css - 正确在这些CSS样式中添加:not选择器,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/23595191/

10-13 06:11