首页 > 解决方案 > 如何仅缩进包含在

元素?

问题描述

我正在工作的网站的文本呈现为段落,内部行由<br>标签分隔。当单行长度超过容器 div 宽度并换行时,如何缩进换行的文本?

我试过在标签上使用margin-leftand ,但是当然,这只是在段落的第一行之后缩进所有内容,这不是我想要的。text-indent<p>

<p>
Assuming that a containing div width is 27 characters, this line would wrap after the word 'containing', meaning that I'd like indentation for any new line created by wrapping within this sentence.
<br>
Then the start of this line should be aligned with 'Assuming' above, and the following lines created by wrapping (if any) should also be indented.
</p>

标签: htmlcss

解决方案


推荐阅读