时间:2021-07-01 10:21:17 帮助过:365人阅读
<style type="text/css">
ul{margin:0 auto;padding:0;
width:400px;background:#F00;
text-align:center;
}
li{
list-style:none;
display:inline-block;
margin:0 10px;width:100px;
background:#0F0;}</style><ul>
<li>1</li><li>2</li><li>3</li></ul>纯css只有给li定宽度才行。
不然就只有用js去算了。