如何让div下的ul标签水平居中

如题所述

<style>
*{margin:0;padding:0;border:0;}
.box{width:400px;height:100px;margin:0 auto}
.box ul{list-style:none;}
.box ul li{float:left;width:100px;height:100px;line-height:100px;background:#00aff0;text-align:center;font-size:14px;color:#fff;}
</style>
<div class="box">
<ul>
<li>演示效果</li>
<li>演示效果</li>
<li>演示效果</li>
<li>演示效果</li>
</ul>
</div>
上面是代码,把代码复制到html文件中,用浏览器打开看看吧。
温馨提示:内容为网友见解,仅供参考
无其他回答
相似回答