我有一种情况,我想使用多个空格来分隔 html 中的元素。除了使用多个
之外还有什么办法吗?
HTML:
<td width="10%">
<a href=""><i class="glyphicon glyphicon-envelope"></i></a>View
<a href=""><i class="glyphicon glyphicon-link"></i></a>Append
<a href=""><i class="glyphicon glyphicon-trash"></i></a>Delete
</td>
我自己弄清楚了: 根据您想要多少空间,可以通过以下方式来实现:
- single space
  - thin space
  - en space(half the point size of the font)
  - em space(point size of the font)
使用 CSS 更改
margin
或 padding
来间隔元素通常是公认的答案。
您也可以疯狂地使用
position: absolute
或 postion: relative
并通过使用 top
和 left
属性来分隔元素。
您可以将其与以下内容一起放置:-
<div class="space_lg"> </div>
CSS
.space_lg
{
width:100px;
}
如果您想要持续更大的空间,您可以使用
word-spacing
:
p:first-of-type {
word-spacing: 2em;
}
<p>Some text that you want spaced</p>
<p>Some text with regular spacing</p>
将
span
标签与 display:inline-block
一起使用,然后添加 width
到其中。
有什么方法可以设置nbsp的数量吗?例如“nbsp=10”或类似的内容?所以我不必写nbspnbspnbspnbspnbspnbspnbspnbspnbspnbsp
没有办法进入太空。你应该多,我之前研究过,我没有找到任何其他方法。只是,如果你想为所有行留出空间,请使用 br。