是否可以在HTML中插入一个制表符,而不必键入 四次吗?


当前回答

理想的CSS代码应该是“display”和“min-width”属性的组合…

display: inline-block;
min-width: 10em; // ...for example, depending on the uniform width to be achieved for the items [in a list], which is a common scenario where tab is often needed.

其他回答

这是一个很难看的解决方法,但是你可以这样做

var tab = '    ';

然后在字符串中使用tab变量。

只有“pre”标签:

<pre>Name:      Waleed Hasees
Age:        33y
Address:    Palestine / Jein</pre>

你可以在这个标签上应用任何CSS类。

最好使用pre标签。pre标记定义预格式化文本。

<pre>
 This is
preformatted text.
It preserves      both spaces

and line breaks.

</pre>

了解更多关于前标签在这个链接

如果你只是想缩进段落中的第一句话,你可以用一个CSS小技巧来做到这一点:

p:first-letter {
    margin-left: 5em;
}

在CSS中有这个:

span.tab{
    padding: 0 80px; /* Or desired space*/
}

然后在你的HTML有这是你的“长标签”在句子中间,就像我需要的:

<span class="tab"></span>

节省&nbsp;或&emsp;这是你需要的。