我在stackoverflow上尝试了很多解决方法,但都没有起作用。
a.buttongc {
border-radius: 5px;
background: #f5b220;
color: #fff;
font-size: 17px;
height: 44px;
line-height: 42px;
color: #fff;
text-decoration: none;
text-align: center;
box-sizing: border-box;
-webkit-appearance: none;
-moz-appearance: none;
-ms-appearance: none;
appearance: none;
white-space: nowrap;
margin: 10px;
text-overflow: ellipsis;
font-family: inherit;
cursor: pointer;
width: 100%;
overflow: hidden;
display: block;
}
.gc-button-center {
position: fixed;
left: 0;
right: 0;
display: block;
width: 100%;
bottom: 50px;
z-index: 999999999;
}
<div class="gc-button-center">
<a href="#" class="buttongc startgc">test</a>
</div>
我想要左右留出边距,但只有左边起作用,而按钮则超出了滚动条。有什么解决办法吗?
box-sizing: border-box
- Ivan Rubinsona
中删除宽度,框尺寸就会正确工作。 - DBS