i'm having this problem with skinning a new site: in ie, the width of a div = actual width + padding in ff, the width = actual width, padding is additional width... as such, if the site looks ok in ie, it's out in ff... and vice versa... i've searched around and although this is discussed in other forums, there is no solution. anyone know how to overcome this?
Use a complete and proper DTD to kick IE into standards mode, where it will use the correct box model. html <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> or xhtml <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> Code (markup): See http://www.w3.org/QA/2002/04/valid-dtd-list.html for all DTDs. cheers, gary
But don't use XHTML unless you are prepared to send it as application/xhtml+xml and dynamically render it into HTML conditionally for Internet Explorer. XHTML sent as text/html is not parsed as XML in XHTML-capable UAs and application/xhtml+xml is not recognised as a render-able MIME type by IE. Fun, isn't it?
No. Mozilla behaviour is correct, it uses the proper W3C box model. IE in quirks mode uses the original broken MS interpretation that you describe in your first post. Implement Gary's suggestion of a proper strict doctype declaration and IE will use the W3C box model, which means it will then behave as Mozilla does. Fix your CSS to work in the W3C model and then you will be fine. In 90% of cases, if there is any discrepancy between MSIE and Mozilla, Mozilla is usually correct. Check other browsers as well, such as Opera, and you will see they usually match Moz's behaviour.