CSS怎么设置英文字母之间的间距

html-css014

CSS怎么设置英文字母之间的间距,第1张

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属性既可以...

可以使用 letter-spacing:*px来控制文字间距,*px是指间距像素

这个不仅可以用在li里,其它需要文字排版的地方都可以使用

举个例子:

.list li {width:200pxtext-align:centerheight:22pxline-height:22pxletter-spacing:5pxoverflow:hiddenclear:both}

说明.list li {li宽度200px 文字居中 li高度22px 行高22px 字间距5px 超出部份隐藏 清除}

用CSS设置网页中文字上下行之间的间距,首先我们需要理解的是一个行高和高的概念,可以通过这个p或者是其他的标签添加一个height和line-height,然后设置相应的数值,就能够实现上下行的间距设置,具体看下代码:

<html>

<head>

<style>

#div{

width:400px

height:300px

}

#div p{

line-height:30px

}

</style>

</head>

<body>

<div id='div1'>

<p>我是测试文字</p>

</div>

</body>

</html>