不使用 blockquote 缩进的 HTML 代码(因此下一行没有空格)

标签 html css

我试图在不使用 block 引号的情况下创建一个缩进文本 block 。我想这样做的原因是 block 引用在缩进的文本 block 和上一段之间添加了一个额外的空间。

alt text

我希望缩进的文本与非缩进的文本齐平。

最佳答案

您可以使用 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/

相关文章:

html - 是否可以使用相同的 svg 但使用不同的文本?

html - Bootstrap 表位置调整

jquery - URL 中的 ID 不隐藏其他 div

html - 什么字符代表文本区域中的新行

html - 图像在不同尺寸的显示器上偏移了几个像素,如何解决?

单击时CSS调整元素大小

html - 具有 100% 高度子 div 的 BS 3.0 粘性页脚

html - 如何使用 css 网格填充列?

javascript - 如何让人们在同一表单上进行协作并实时更新?

html - 具有指定高度(在 CSS 中)的 div 可以自动缩放吗?