我正在使用这个教程中的CSS按钮:
http://www.oscaralexander.com/tutorials/how-to-make-sexy-buttons-with-css.html
我需要将一个按钮放在DIV中间使其居中。但是我做不到!
以下是按钮的代码:
<a class="button" href="#"><span>Bring world peace</span></a>
这里是 CSS:
.clear { /* generic container (i.e. div) for floating buttons */
overflow: hidden;
width: 100%;
}
a.button {
background: transparent url('bg_button_a.gif') no-repeat scroll top right;
color: #444;
display: block;
float: left;
font: normal 12px arial, sans-serif;
height: 24px;
margin-right: 6px;
padding-right: 18px; /* sliding doors padding */
text-decoration: none;
}
a.button span {
background: transparent url('bg_button_span.gif') no-repeat;
display: block;
line-height: 14px;
padding: 5px 0 5px 18px;
}
这是我正在尝试使用的代码:
<div align="center"><a class="button" href="#"><span>Bring world peace</span></a></div>