我在谷歌浏览器中的CSS <buttons>有问题,它显示<buttons>之间的空格,但在Opera和IE中它是可以的,为什么?
下面是完整的CSS代码:
button {
border: 1px solid #bdbdbd;
text-shadow: 0 1px 1px white;
font: bold 11px Sans-Serif;
padding: 6px 8px;
white-space: nowrap;
vertical-align: middle;
color: #666;
background: -webkit-linear-gradient(top, white, #E0E0E0);
background: -moz-linear-gradient(top, white, #E0E0E0);
background: -ms-linear-gradient(top, white, #E0E0E0);
background: -o-linear-gradient(top, white, #E0E0E0);
cursor: pointer;
text-decoration: none;
margin-right: -1px;
}下面是HTML代码:
<div><button type="button">Send</button><button type="button">Reset</button></div>谢谢你的帮助。
发布于 2012-02-12 08:41:27
似乎也是左边距。这会在Chrome中纠正它(不确定它在其他浏览器中会做什么)……我编辑了边距属性。
button {
border: 1px solid #bdbdbd;
text-shadow: 0 1px 1px white;
font: bold 11px Sans-Serif;
padding: 6px 8px;
white-space: nowrap;
vertical-align: middle;
color: #666;
background: -webkit-linear-gradient(top, white, #E0E0E0);
background: -moz-linear-gradient(top, white, #E0E0E0);
background: -ms-linear-gradient(top, white, #E0E0E0);
background: -o-linear-gradient(top, white, #E0E0E0);
cursor: pointer;
text-decoration: none;
margin: 0 -1px 0 0;
}发布于 2012-02-12 08:35:20
每组按钮都包含在具有三(3)个像素的margin-left的div中。
EDIT Chrome还应用一(1)像素的默认边距。您需要将按钮的边距设置为零(0),以消除此间距。
https://stackoverflow.com/questions/9245351
复制相似问题