在一行中有三个按钮或是两个按钮...个数不定,然后间距固定;然后就有很多人把所有按钮放到一个div中,把div置为margin:10px auto(距上10像素,居中,然后又给了一个固定宽度,按钮放在这个div中,这样按钮就不能具体居中了) ,也不通用如果按钮减少到两个 或一个怎么办,
也有很多人用javascript 动态的算出宽度然后计算一大堆,并且很多时候比好用
错误代码:
1 2 3 4 5 6 7 .foot{width: 100%; height: 30px; border: 1px solid #d2d2d2;} 8 .foot .b{width:300px; margin: 3px auto;} 9 .foot .b .button{display: inline-block;line-height: 20px; background-color: #900; padding: 3px 5px; margin-left: 10px;}10 11 12 1314
15 提交16 提交17 提交18
查看更多关于css多个不定数量提交按钮居中显示,纯css解决_html/css_WEB-ITnose的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did109307