我有这样的css:
p{
margin: .85em auto;
line-height: 1.7;
text-indent: 2em;
}
blockquote p {
text-indent: 0;
}有没有办法用手写笔来优化它呢?
只是为了做这样的事情:
p{
margin: .85em auto;
line-height: 1.7;
(not if blockquote) text-indent: 2em;
}HTML我正在尝试将其应用于
<div class="entry">
<p></p> //text-indent here
<blockquote>
<p></p> //no text-indent here
</blockquote>
</div>发布于 2016-11-02 16:33:41
手写笔无法读取HTML以了解是否有包装p标签的blockquote。即使您的代码可以正常工作,我也看不出比您拥有的CSS有任何优势。也许在普通的CSS中,你可以使用:not伪类来节省一行代码:
p {
margin: .85em auto;
line-height: 1.7;
}
:not(blockquote) > p {
text-indent: 2em;
}https://stackoverflow.com/questions/40352952
复制相似问题