我无法将一个小横幅添加到我博客的标题上。我希望它在中心并靠近标题的按钮。可能可以用一些样式属性来实现,但我找不到它。这是它现在的样子 pctechtips.org
<div id="header_add" style="background-color:#000000;height:70px;width:500px;float:center;align:center;">
<a style="color:yellow" href="http://pctechtips.org/contact/"><small>PCtechtips.org</small></a>
<h2 style="color:blue;text-align:center;top-padding:0">Advertise Here!</h2>
</div>
答案 0 :(得分:0)
将水平边距设置为自动:
<div id="header_add" style="background-color:#000000;height:70px;width:500px;margin:0 auto;">
<a style="color:yellow" href="http://pctechtips.org/contact/"><small>PCtechtips.org</small></a>
<h2 style="color:blue;text-align:center;top-padding:0">Advertise Here!</h2>
</div>
请查看本文中有关自动边距的部分:http://css-tricks.com/almanac/properties/m/margin/