[thelist] CSS Problem with Mozilla

Andrew Chadwick andrew.chadwick at prnewswire.co.uk
Fri Sep 28 06:42:26 CDT 2001


On Fri, Sep 28, 2001 at 12:51:29PM +1000, Red Wolf wrote:
> I've got a problem with horzontal rules on Mozilla.
> 
> They are shifting to the left of the bounds of the div thay are in, are 
> running over a floating navigation box and refuse to display in as 
> single pixel, single colour lines.

That's wierd... the layout issue is surprising enough to warrant
archiving its fix as a <tip/>, so I have. As for getting Mozilla
(0.9.4 in my case) to show HRs as thin single-colour lines, try

  hr { height: 0; border: solid red 0; border-top-width: thin; }



<tip type="Mozilla, standards, quirks, horizontal rules, block, inline">

When laying out <hr/>s, Mozilla's default in Standards mode is for
them to be rendered as block elements, meaning they go right through
floating elements, and their inline content adapts to the floaters,
not the <hr/> itself. Not that <hr/>s ever have any inline content.

That's different from just about every other implementation, including
IE6 and Mozilla's own Quirks mode, all of which treat HRs as inline
elements. But wait! Mozilla's tiny, walnut-sized brain is actually
getting it right according to the HTML4 DTD, which mentions HR as a
block-level entity.

That's why you can't put <hr/>s inside paragraphs, BTW.

You can emulate the old behaviour even in Standards mode by saying
"hr { display: inline; }" in your stylesheet.

</tip>


-- 
Andrew Chadwick, UNIX/Internet Programmer, PR Newswire Europe, Oxford
--
The views or opinions above are solely mine and are not necessarily those
of PR Newswire Europe. The message may contain privileged or confidential
information; if you are not a named recipient, notify me, and do not copy,
use, or disclose this message. <andrew.chadwick at prnewswire.co.uk>.




More information about the thelist mailing list