Re: Horizontal rules

--- 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 UTC