[thelist] opera bug with <hr>?

Andrew Clover and at doxdesk.com
Sat Apr 20 18:28:01 CDT 2002


Marc Seyon <seyon at delime.com> wrote:

> An <hr> in the righthand div stretches across the entire page, rather than
> just the width of its parent div.

This could be considered correct behaviour. HR is loosely specified in HTML,
but the non-normative 'sample style sheet' in the CSS 2 specification
describes it as a normal block element with a border to get the rule
effect.

Block elements are not repelled by floats - only text is. Hence the content
area of the <hr> stretches across the complete content area of its parent,
including the part taken up by the float. This must be so because text
further down in that block, below the float, would have to wrap underneath
it, and a block can have only one left edge. So the box generated by the
<hr> spans the entire window, and therefore its border must do also.

This leads to another problem people are bumping into with IE6/Standards:
the right-hand div, taking up the whole width of the window, should actually
be positioning *above* the left-hand div according to my reading of the CSS
spec, and that's what IE6 does. This is not very helpful, though, as it
means you can't click on anything in the left div, and if you give the
right div a background you won't see anything in the left div at all.

There is a case for altering/extending CSS to better match authors'
expectations here, I think.

Anyway, the solution to all this is to give the right div a left-margin
big enough to make space for the left div.

--
Andrew Clover
mailto:And at doxdesk.com
http://and.doxdesk.com/



More information about the thelist mailing list