为了账号安全,请及时绑定邮箱和手机立即绑定

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

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

森林海 2019-03-13 11:09:50
<!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>代码贴出了 我想让字 横向排列上有间距...
查看完整描述

2 回答

?
GCT1015

TA贡献1827条经验 获得超4个赞

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

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

举个例子:
.list li {width:200px; text-align:center; height:22px; line-height:22px; letter-spacing:5px; overflow:hidden; clear:both;}

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

查看完整回答
反对 回复 2019-03-18
  • 2 回答
  • 0 关注
  • 2622 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号