可能的方法:
<pre> ... </pre>
or
style="white-space:pre"
还有别的事吗?
可能的方法:
<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创建制表符和空格。
其他回答
HTML中的空格类型
在文本之间创建四个空格 
在文本之间创建两个空格 
在文本之间创建一个规则的空格-
创造一个狭窄的空间(类似于常规空间,但略有不同- “&thinsp”;
句子间距- "</br>"
这个链接可能对你有帮助。查看[https://hea-www.harvard.edu/~fine/Tech/html-sentences.html]
<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创建制表符和空格。
空格的宽度/高度超出 我通常使用:
对于水平垫片:
<span style="display:inline-block; width: YOURWIDTH;"></span>
对于垂直垫片:
<span style="display:block; height: YOURHEIGHT;"></span>
我喜欢用这个:
在CSS中:
.tab {
display:inline-block;
margin-left: 40px;
}
在你的HTML中:
<p>Some Text <span class="tab">Tabbed Text</span></p>
User8657661的答案最接近我的需求(跨几行对齐)。然而,我无法让示例代码像提供的那样工作,但我需要如下更改:
<html>
<head>
<style>
.tab9 {position:absolute;left:150px; }
</style>
</head>
<body>
Dog Food: <span class="tab9"> $30</span><br/>
Milk of Magnesia:<span class="tab9"> $30</span><br/>
Pizza Kit:<span class="tab9"> $5</span><br/>
Mt Dew <span class="tab9"> $1.75</span><br/>
</body>
</html>
如果你需要右对齐的数字,你可以改变左:150px到右:150px,但你需要改变基于屏幕宽度的数字(写的数字将是150像素从屏幕的右边缘)。