Forum Moderators: not2easy

Message Too Old, No Replies

help with box model in IE 6

         

sodani

4:00 am on Oct 3, 2006 (gmt 0)

10+ Year Member



This is really frustrating me to no end because I thought that I had the box model figured out. I have 2 <li>s floated left inside a parent block - a ul. The width of the ul block is 462px. Margins and padding are set to zero and there is a 1px border around the whole block.

For the li blocks (there are 2 of them), the width is set to 211px and there is a 10px margin around all sides. So each li block would be a width of 231, and if you add it up, it should be 462.

However, they're not lining up next to each other in IE6. I have to drop the width of the li blocks considerably for them to line up next to each other. Does anyone know why?

Setek

4:29 am on Oct 3, 2006 (gmt 0)

10+ Year Member



Why don't you force IE into standards-compliance mode to fix the box model problems?

  1. Have a full and correct doctype; and
  2. Make sure the doctype starts as the very first character (no whitespace nor
    <?xml
    declaration, nor anything else.)

If you notice no difference between IE's render of the box model vs. Firefox's render of the box model, you've just successfully pushed IE into standards-compliance mode :)

sodani

4:38 am on Oct 3, 2006 (gmt 0)

10+ Year Member



That's good to know. I didn't know about that. I'll try it out.