我有一个<hr>
需要为其父级宽度的 80% 和“左对齐”,而不是默认居中。
<div>
<p>Some stupid text</p>
<hr>
<p>Ask a stupid text, what?</p>
</div>
我通过使用以下方法在现代浏览器中解决了这个问题:
hr
{
width: 80%;
color: #90b124;
background: #90b124;
height: 4px;
border: 0;
margin: 20px 0;
position: relative;
left: 0;
}
但在 IE(所有版本)中,它仍然居中。设计要求这个左侧定位的小时。当然,我可以只使用 a<span>
并称其为一天,但这不那么语义化。
有没有办法在 IE 中将其定位为 deisred ?