I have the following div
<body>
<span style="border:1px solid red; display:inline-block">
Some text<br />
<hr />
some more text
</span>
</body>
In “normal” web browsers, the width of the div is calculated to fit the text. And the hr is 100% of the div.

But in IE7 the hr causes the div to expand to 100% of the body.

Is there any clever css I need to add somewhere so it behaves correctly in IE7?
Please note, I can’t set any fixed width.
The
widthproperty of the<hr>tag has been deprecated, so you’re styling options are limited on the<hr>tag.A more modern approach is to use the
borderproperty of a<div>instead.Image rendered by IE 7:
Image rendered by Chrome 19:
HTML
CSS
Note: IE 6 & 7 don’t support
display:inline-block, so you might need to usefloat:leftinstead. The article below compares the use of the aforementioned properties: