[英]How can I make an H4 element behave like an HR when floats are present
Here's my code: 这是我的代码:
http://jsfiddle.net/beA4a/ http://jsfiddle.net/beA4a/
<div style="float:right; width:200px; border:solid 1px #000; height:300px;"></div>
<p>Text</p>
<hr/>
<h4 style="border-bottom:solid 1px #000;">H4 Text</h4>
Notice how the hr
stops at the floated div but the h4 passes right thru it. 注意
hr
如何在浮动div处停止的,而h4则通过它。 Is there any CSS I can apply to the h4 to make it behave the same way without specifying a width on the h4? 我可以将任何CSS应用于h4,使其行为相同,而无需在h4上指定宽度吗?
I want it so that if the h4 was pushed below the floated div it would then take up the full page width as the hr would. 我想要这样,如果将h4推到浮动div下方,则它将像hr一样占据整个页面宽度。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.