用手写笔优化CSS

时间:2016-11-01 01:31:25

标签: css stylus

我有这样的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>

1 个答案:

答案 0 :(得分:1)

手写笔无法读取HTML,知道您是否blockquote包裹p标记。即使您的代码有效,我也不会发现您拥有的CSS优势。也许在纯CSS中,您可以使用:not伪类来保存一行代码:

p {
  margin: .85em auto;
  line-height: 1.7;
}

:not(blockquote) > p {
  text-indent: 2em;
}