可能的方法:

<pre> ... </pre>

or

style="white-space:pre"

还有别的事吗?


当前回答

<p style="text-indent: 5em;">
The first line of this paragraph will be indented about five characters, similar to a tabbed indent.
</p>

这个段落的第一行缩进大约5个字符,类似于标签缩进。

有关更多信息,请参见如何使用HTML和CSS创建制表符和空格。

其他回答

你可以使用这个代码&#8287;在HTML内容中添加空格。对于制表符,使用它5次或更多。

在这里查看一个示例:https://www.w3schools.com/charsets/tryit.asp?deci=8287&ent=ThickSpace

<p style="text-indent: 5em;">
The first line of this paragraph will be indented about five characters, similar to a tabbed indent.
</p>

这个段落的第一行缩进大约5个字符,类似于标签缩进。

有关更多信息,请参见如何使用HTML和CSS创建制表符和空格。

我喜欢用这个:

在CSS中:

.tab { 
       display:inline-block; 
       margin-left: 40px; 
}

在你的HTML中:

<p>Some Text <span class="tab">Tabbed Text</span></p>

<span style=“padding-left:68px;”></span>

你还可以使用:

padding-left
padding-right
padding-top
padding-bottom

在我的例子中,我需要在每段的开头插入,所以我做了下面的事情,它对我很有效,我希望它能帮助到别人

p:first-letter {
    margin-left: 20px
}