【发布时间】:2018-02-25 12:49:55
【问题描述】:
我想将一些按钮对齐到页面的中心。请问我可以在我的CSS中如何做到这一点。
button {
background-color: #6495ED;
color: white;
padding: 16px 25px;
margin: 0 auto;
border: none;
cursor: pointer;
width: 100%;
border-radius: 8px;
display: block;
position: middle;
}
<button type="button" onclick="document.getElementById('id01').style.display='block'" style="width: auto;">User Login</button>
<br><br><br>
<button type="button" onclick="document.getElementById('id02').style.display='block'" style="width:auto; ">Admin Login</button>
【问题讨论】:
标签: html css flexbox vertical-alignment