【发布时间】:2014-03-14 23:24:31
【问题描述】:
如何在 html5 中使按钮居中? 通过修改css文件。 我不想在 html 代码中使用 center 标记。
a.read{
padding:10px 20px;
font-size:14px;
line-height:20px;
background-color:#eba73c;
text-align:center;
color:#fff;
border-radius:5px;
text-decoration:none;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
text-align:center;
display:inline-block;
clear:both
}
【问题讨论】:
-
要居中,你给它
margin: 0 auto; -
谢谢佩德罗,但我已经尝试过了。 jsfiddle.net/AndersN/YT4Uk