猿问

css样式里li列表里 文字间距怎么设置?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style>
body { font-family:Verdana; font-size:14px; margin:0;}

#indexx {margin:0 auto; width:900px;}
#headx { height:100px; background:red; margin-bottom:3px;}
#ok { height:30px; background:#09c; margin-top:3px;}
#content{height:500px; margin-top:5px;}
#left{float:left;width:200px;height:500px;background:#9ff;}
#right{float:right;width:700px;height:500px;}
#ri{height:200px;background:#eeee11;}
#rx{height:300px;background:#FF69B4;}
#foot{height:80px;background:red;}
ul.inventory{ list-style-type: none;}
li{float:left}

</style>
</head>
<body>
<div id="indexx">

<div id="headx"></div>

<div id ="ok"></div>

<div id="content">

<div id="left"><ul class="inventory"><li>访问量</li><li>留言</li><li >更新</li></ul></div>

<div id="right">
<div id="ri"></div>
<div id="rx"></div>
</div>

</div>
<div id="foot"></div>
</div>

</body>
</html>

代码贴出了 我想让字 横向排列上有间距...

森林海
浏览 2488回答 2
2回答

GCT1015

可以使用&nbsp;letter-spacing:*px; 来控制文字间距,*px是指间距像素这个不仅可以用在li里,其它需要文字排版的地方都可以使用举个例子:.list li {width:200px;&nbsp;text-align:center; height:22px;&nbsp;line-height:22px;&nbsp;letter-spacing:5px; overflow:hidden; clear:both;}说明.list li {li宽度200px; 文字居中; li高度22px; 行高22px; 字间距5px; 超出部份隐藏; 清除;}
随时随地看视频慕课网APP

相关分类

CSS3
我要回答