Html 如何使用div标签将小横幅居中放置在标题上

Html 如何使用div标签将小横幅居中放置在标题上,html,css,Html,Css,我无法将一个小横幅添加到我的博客标题的中心。我希望它在中间,靠近标题的按钮。可能可以通过一些样式属性实现,但我找不到它。这是它现在的样子 在这里登广告! 将水平边距设置为自动: <div id="header_add" style="background-color:#000000;height:70px;width:500px;margin:0 auto;"> <a style="color:yellow" href="http://pctechtips.org/cont

我无法将一个小横幅添加到我的博客标题的中心。我希望它在中间,靠近标题的按钮。可能可以通过一些样式属性实现,但我找不到它。这是它现在的样子


在这里登广告!

将水平边距设置为自动:

<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>

在这里登广告!

查看本文中有关自动边距的部分:

可能重复的
float:center
不存在margin:0 auto。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>