css word-spacing 怎么用

html-css016

css word-spacing 怎么用,第1张

word-spacing 属性增加或减少单词间的空白(即字间隔)。

该属性定义元素中字之间插入多少空白符。针对这个属性,“字” 定义为由空白符包围的一个字符串。如果指定为长度值,会调整字之间的通常间隔;所以,normal 就等同于设置为 0。允许指定负长度值,这会让字之间挤得更紧。

例如下面的例子:

<html>

<head>

<style type="text/css">

p.spread {word-spacing: 30px}

p.tight {word-spacing: -0.5em}

</style>

</head>

<body>

<p class="spread">This is some text. This is some text.</p>

<p class="tight">This is some text. This is some text.</p>

</body>

</html>

CSS用word-spacing属性来设置单词的间距。例如: p.spread {word-spacing: 30px} p.tight {word-spacing: -0.5em} This is some text. This is some text. This is some text. This is some text.效果如图: 可以看到,word-spacing属性既可以...

您好,要使下边框border左边有距离右边顶对齐,首先要在CSS中使用margin属性,margin属性可以让您控制元素的外边距,以便让元素与其他元素保持一定的距离。您可以使用margin-right属性来设置元素右边的边距,以便让元素与右边的元素保持一定的距离。例如,您可以使用以下代码来设置border左边的距离:

border-left: 200px

margin-right: 200px

这样,border左边就会有200px的距离,而右边的元素也会有200px的距离