如何使按钮响应并居中?
How to make a button responsive and centered?
我想使按钮居中且响应迅速。但我不能给它一个宽度,否则背景颜色会随之改变。有什么解决办法吗?
代码:
background-color: #03326c;
font-size: 25px;
height: 35px;
margin-left: 530px;
margin-top: -70px;
position: relative;
text-align: center;
width: 180px;
z-index: 100000;
}
<div class="product-button1"><a href="http://blabla.com/blabla.html" title="reserveren"><span class="reserverenButton1">Reserveer hier</span></a></div>
目前还不清楚这到底会是什么样子,我们根据您的代码获得的信息有限,但这会起作用。
不清楚按钮 "responsive" 是什么意思,但它居中且未定义宽度。
.product-button1 {
text-align: center;
}
product-button1 a {
background-color: #03326c;
font-size: 25px;
height: 35px;
position: relative;
text-align: center;
display: inline-block;
color: white;
padding: .5em 1em;
}
<div class="product-button1">
<a href="http://blabla.com/blabla.html" title="reserveren"><span class="reserverenButton1">Reserveer hier</span></a>
</div>
我想使按钮居中且响应迅速。但我不能给它一个宽度,否则背景颜色会随之改变。有什么解决办法吗?
代码:
background-color: #03326c;
font-size: 25px;
height: 35px;
margin-left: 530px;
margin-top: -70px;
position: relative;
text-align: center;
width: 180px;
z-index: 100000;
}
<div class="product-button1"><a href="http://blabla.com/blabla.html" title="reserveren"><span class="reserverenButton1">Reserveer hier</span></a></div>
目前还不清楚这到底会是什么样子,我们根据您的代码获得的信息有限,但这会起作用。
不清楚按钮 "responsive" 是什么意思,但它居中且未定义宽度。
.product-button1 {
text-align: center;
}
product-button1 a {
background-color: #03326c;
font-size: 25px;
height: 35px;
position: relative;
text-align: center;
display: inline-block;
color: white;
padding: .5em 1em;
}
<div class="product-button1">
<a href="http://blabla.com/blabla.html" title="reserveren"><span class="reserverenButton1">Reserveer hier</span></a>
</div>