我试图在不使用 block 引号的情况下创建一个缩进文本 block 。我想这样做的原因是 block 引用在缩进的文本 block 和上一段之间添加了一个额外的空间。
我希望缩进的文本与非缩进的文本齐平。
最佳答案
您可以使用 padding-left 和 display: block CSS 属性,然后将要缩进的文本换行。 例如:
<p>
Lorem Ipsum is simply dummy text of the printing and typesetting industry.
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,
when an unknown printer took a galley of type and scrambled it to make a type specimen book.
<span style="padding-left: 20px; display:block">
It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.
</span>
It was popularised in the 1960s with the release of Letraset sheets containing Lore
</p>
关于不使用 blockquote 缩进的 HTML 代码(因此下一行没有空格),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4530957/