RE: CSS2 - DIVs, Lists and Margins - No Respect

Thanks for your reply, Rijk.

Unfortunately, this solution causes problems when the browser window is
narrowed (assuming a longer list) and the content of the lists wrap below
the floating <div>.


If I include:

   ol {margin-left: 10em;}

in the style, for instance, everything's fine until the content clears below
the <div> and I am stuck with an unwanted and unnatural left-margin off the
left page.


As it is, the <ol> list's number 1. should vertically align close to 1em to
the right of beginning of the first word "Interdum," (as it would normally,
isolated from any floating <div>), but it does not.


There's got to be a better way. Maybe this functionality isn't including in
this specification ?

-- Derek



-----Original Message-----
From: Rijk van Geijtenbeek [mailto:rijk@cistron.nl]
Sent: Saturday, January 12, 2002 6:49 PM
To: Derek Rogerson
Subject: Re: CSS2 - DIVs, Lists and Margins - No Respect


Hello Derek,

On Sunday, January 13, 2002 you wrote:

> I am new to this list but perhaps someone could help.

> I am unable to get my lists to respect a *floating <div> margin.

> The <h3> and <p> elements will stay the required right-margin 24px's away
> from the floating div#greek, but the lists (ol, ul) will not. I have tried
> giving the lists their own margins but they move from the page margin, not
> from the div, which works fine, but doesn't seem the right way.

> Do I need to set the lists to some display attribute? Please help.

[..]

Your code displays without any overlapping in my copies of MSIE 6,
Mozilla .9.7 and Opera 6.01. The left margin of the H3, P and the list
is *not* influenced by the float, only the content of those elements
is pushed to the right. If you'd add borders to those elements you
could see more clearly what happens. The way the three browsers I used
treat the bullets/numbers of the lists varies, and some put them
inside this 24px space to the right of the DIV. That's not really
pretty. To prevent this, you need to set explicit left margins to the
OL.


Greetings,
 Rijk                            mailto:rijk@cistron.nl

Mot du Jour:
Clones are people two.

Received on Saturday, 12 January 2002 23:14:15 UTC