November 16th, 2003, 11:33 PM
CSS padding question
so i decided to twiddle with some css layout instead of using the ol' tables. my code is certainly cleaner, but doesn't seem to want to work the same on mozilla as it does on IE, specifically with the way the padding attributes are handled.
in mozilla, why is it when i specify a padding-left or padding-right attribute, the width of the div equals the width + padding-right + padding-left, and in IE, the width of the div is width? example:
in mozilla, the actual width of this div is 636px. in IE, it's 620px. i thought the padding just made sure the text had a buffer between it and the div boundary.
some clarification, pweeeze? thanks a bunch.
November 16th, 2003, 11:45 PM
B/c the folks over at M$ can't read. The way Mozilla handles it is correct according to the W3C's specifications. As with most things, there is a workaround ... http://glish.com/css
Explain your problem instead of asking how to do what you decided was the solution.
November 17th, 2003, 12:13 AM
that's the site that i've been using for examples. i looked in the hacks section but couldn't find the fix. i'm using IE 6 and the fixes all refer to IE5.x.
thanks for the help.
November 17th, 2003, 05:10 AM
November 17th, 2003, 11:22 AM
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
and it fixed one thing in IE, but broke another. apparently, IE cannot (or will not) render a DIV that's less than 5 px wide. mozilla renders it fine, but when i try and render a DIV with a width of 3px, IE renders it as 5px. eh, it's something i can live with, but i'll be happy in a few years when all the browsers render code the same (yes, i'm not holding my breath).
thanks a bunch!
November 17th, 2003, 04:13 PM
LOL! Me too! Although I think people have been saying that for years. Hopefully with "standards compliant" becoming more and more important, it won't be much longer. But like you, I won't hold my breath.