我希望缩进段落的第一行(就像 text-indent
CSS 属性所做的那样),但只对多行的段落进行操作。如果段落只有一行,我不想将其缩进。
是否有类似的解决方法?
p {
text-indent: 20px;
max-width: 350px;
}
<p>This is a pretty long paragraph which spans over a few lines. For that reason I wish its first line to be indented (as it should be).</p>
<p>These are short paragraphs.</p>
<p>I don't want them indented.</p>
<p>Unless they take multiple lines.</p>