【发布时间】:2018-03-25 16:34:50
【问题描述】:
在 IE 上使用 display: block 将按钮居中是否正确,或者我应该寻找一种将 WebKit-center 用于其他浏览器的方法?
@media screen and (max-width: 767px) {
.flex {
display:inline-block;
}
.flex_height {
display:inline-block;
}
.grid_8 {
background-repeat:no-repeat;
width:98%;
margin-left:1%;
margin-right:1%;
text-align:-webkit-center;
text-align:-moz-center;
margin-left:auto;
margin-right:auto;
}
}
<div class="grid_8">
<button type="button" class="button_home mobile_on">
*php code to generate text for a button here*
</button>
</div>
【问题讨论】:
-
为什么不
text-align: center;? -
试过了,按钮不动
-
你的css与html无关
-
@TylerH 我怎样才能让它变得更好?对我应该包含的内容有点困惑
标签: css button text-align