W3C home > Mailing lists > Public > www-style@w3.org > February 2000

Re: Horizontal rules

From: Matthew Brealey <thelawnet@yahoo.com>
Date: Fri, 18 Feb 2000 04:12:35 -0800 (PST)
Message-ID: <20000218121235.21773.qmail@web902.mail.yahoo.com>
To: www-style@w3.org
--- Allan Odgaard <Duff@DIKU.DK> wrote:
> On 17-Feb-00, Matthew Brealey wrote:
> 
> >> No, it was the image that I wanted to float (to the left), the 'div'
> was
> >> just a dummy container. Normally the above would be rendered as:
> [...]
> > No.
> > This is the correct rendering, assuming the HR's margin-top is equal
> to
> 
> Well, I moved the ruler one line down so that I could better show the

> > The HR is not affected by the image.
> 
> And this is exactly my point, cause it would have been affected by the
> image in
> normal (non CSS) HTML.
> 
> > Floats are one of the two exceptions to the 'later elements in the
> > document tree stack on top' rule (the other being z-index).
> 
> I know this, and I think my drawing shows it as well -- but my point has
> nothing to do with margin-top nor z-index but with the fact that an
> author
> using HR together with floats (Img with Align set to Left or Right) will
> get a
> counterintuitive result, 
No, the result is fine.

Returning to your ASCII art, this time with the HR given a (bigger than
IMG padding-top + border-top + margin-top) margin-top, this time

+---------------- div ---------------+
| +-------+                          |
|=|       |====== HR ================|
  | Image |
  |       |
  +-------+
This is the correct version, and I think you will agree that the result is
good.
The one circumstance that I think is potentially problematic is where an
image has some degree of transparency. However, this problem is removed if
you give the image a background (although I'm not sure whether backgrounds
are supported on transparent images by any or many browsers).


=====
----------------------------------------------------------
From Matthew Brealey (http://members.tripod.co.uk/lawnet (for law)or http://members.tripod.co.uk/lawnet/WEBFRAME.HTM (for CSS))
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com
Received on Friday, 18 February 2000 07:12:37 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:04 GMT