Log in

View Full Version : width not equal in all browsers



james438
08-08-2007, 05:08 PM
I have recreated a test page (http://www.animeviews.com/test.php) where you can see the problem. (link no longer shows the bad code)

I added the -moz-box-sizing: border-box; to Firefox to get it to display properly, and added


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

to get ie to behave, but I hear that the transitional is going out of date, so I changed it to strict. Here is the code for the page:


<html>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<div style='padding-left:60&#37;;width:70%;box-sizing:border-box;
-moz-box-sizing:border-box;background-color:blue;'>
<div style='padding:1em;background-color:orange;'>
</html>

Any ideas why the above is expressed differently in IE7?

james438
08-10-2007, 07:39 AM
I found the answer in this thread (http://www.dynamicdrive.com/forums/showthread.php?t=18467).

The problem comes from IE not recognizing percentages when determining widths of padding, borders, margins, and I do not know what else...