[thelist] css margin problems

Diego webmaster at sci-web.com.ar
Thu Oct 31 15:36:01 CST 2002


From: "Eduardo Dominguez" <lalo at teligens.com>
Sent: Thursday, October 31, 2002 5:09 PM
Subject: [thelist] css margin problems


> I cant seem to get margins to display correctly on IE6 (I think its
> caused by margins) on my page. WIth mozilla it just looks good, but in
> IE, the distance between divs is very big. I want a 20 pixel separation
> betweend the four divs.

Margins are acumulative in IE. If you set '20px' margin for a div, and the
adjacent div to the right holds 20px margin too, the resulting margin would
be 40px. Mozilla does not treat margins like this.

> Is there any css tricks so that I can make IE6 and Mozilla look more
> alike ? I dont really care much for IE5.x browsers.
>

I don't know of any, however, you could use a 'neutral' or 'middle' value
that shows acceptably for both browsers, but the page will not look the same
in both. If you use percentages instead of pixels, it only gets more
complicated. Mozilla treats percentages in a way that they are acumulative
and for example the width of the page results always in more than 100%
depending on the values. IE treats percentages in a more logical, or perhaps
practical way, so the width does not exceeds the 100%. Of course I'm not
comparing browsers, not saying one is better than the other, just pointing
single browser issues

Hope that helps a little,

regards
Diego (sci_Fi)
http://sci-web.com.ar








More information about the thelist mailing list