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


当前回答

我只想建议:

/* In your CSS code: */
pre
{
    display:inline;
}

<!-- And then, in your HTML code: -->

<pre>    This text comes after four spaces.</pre>
<span> Continue the line with other element without braking </span>

其他回答

阿菲克,唯一的办法就是使用

&nbsp;

如果你可以使用CSS,那么你可以使用填充或边距。参看Box模型,而对于ie浏览器,也可参阅ie浏览器的Box模型bug。

下面是HTML提供的插入空白的3种不同方法

类型,要添加单个空格。 类型&ensp;加两个空格。 类型&emsp;加4个空格。

理想的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.

有一个简单的css:

white-space: pre;

它保留您在HTML中添加的空格,而不是统一它们。

使用CSS更简洁。试试padding-left:5em或margin-left:5em。