我的 hr
有问题HTML 中的标记,因为它不会像我期望的那样自动居中。这就是我当前的代码:
<div id = "updatestatus" class = "statuscontainer">
<div class = "verticalalign">Update Status</div>
</div>
<hr width = "95%">
<div id = "insertstatus" class = "statuscontainer">
<form></form>
</div>
如您所见,我将 hr
两个之间的标签 div
s,我相信它应该自动居中,但最终却偏向左侧。我也试过hr align = center
也没有成功。
编辑:我刚刚意识到,当我放置整个 hr
在 <center></center>
内标记它居中,但我仍在努力弄清楚为什么它不以自己为中心。
最佳答案
试试 margin: auto;
<hr style="width:100px; margin: auto;" />
关于html - 居中 <hr> 标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24749399/