[英]center using margin:auto for an img in a paragraph is not working
我试图将图像居中放置在<p>
我使用了该网站http://www.w3.org/Style/Examples/007/center.en.html ,并且在此处也找到了类似的示例,但似乎无济于事。
我的HTML代码是
<div class="span4">
<h3 class="aglow" id="h3Body">Forms</h3>
<p>
<a class="btn btn-link "href="teacher_forms_list.html">
<img class="operationsButtons" src="NewForms.png" alt="forms">
</a>
</p>
</div>
和我的CSS
img.operationsButtons {
display: block;
margin-left: auto;
margin-right: auto;
}
但由于某种原因,图像仍在左侧(附加图像图片和位于其中心的h3)
谢谢您的帮助
简单的说
p
{
text-align: center;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.