想要在 html 中使用多个 ?

问题描述 投票:0回答:7

我有一种情况,我想使用多个空格来分隔 html 中的元素。除了使用多个

 
之外还有什么办法吗?

HTML:

<td width="10%">
    <a href=""><i class="glyphicon glyphicon-envelope"></i></a>View&nbsp;&nbsp;&nbsp;
    <a href=""><i class="glyphicon glyphicon-link"></i></a>Append&nbsp;&nbsp;&nbsp;
    <a href=""><i class="glyphicon glyphicon-trash"></i></a>Delete
</td>
html format whitespace
7个回答
9
投票

我自己弄清楚了: 根据您想要多少空间,可以通过以下方式来实现:

&nbsp;    - single space
&thinsp;  - thin space
&ensp;    - en space(half the point size of the font)
&emsp;    - em space(point size of the font)

1
投票

使用 CSS 更改

margin
padding
来间隔元素通常是公认的答案。

您也可以疯狂地使用

position: absolute
postion: relative
并通过使用
top
left
属性来分隔元素。


0
投票

您可以将其与以下内容一起放置:-

<div class="space_lg">&nbsp;</div>

CSS

.space_lg
{
width:100px;
}

0
投票

如果您想要持续更大的空间,您可以使用

word-spacing
:

p:first-of-type {
    word-spacing: 2em;
}
<p>Some text that you want spaced</p>
<p>Some text with regular spacing</p>


0
投票

span
标签与
display:inline-block
一起使用,然后添加
width
到其中。


0
投票

有什么方法可以设置nbsp的数量吗?例如“nbsp=10”或类似的内容?所以我不必写nbspnbspnbspnbspnbspnbspnbspnbspnbspnbsp


-4
投票

没有办法进入太空。你应该多,我之前研究过,我没有找到任何其他方法。只是,如果你想为所有行留出空间,请使用 br。

© www.soinside.com 2019 - 2024. All rights reserved.