Results 1 to 2 of 2

Thread: width not equal in all browsers

  1. #1
    Join Date
    Jan 2007
    Location
    Davenport, Iowa
    Posts
    2,385
    Thanks
    100
    Thanked 113 Times in 111 Posts

    Default divs and padding in IE7

    I have recreated a test page 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

    Code:
    <!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:

    Code:
    <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?
    Last edited by james438; 08-10-2007 at 07:43 AM. Reason: problem simplified

  2. #2
    Join Date
    Jan 2007
    Location
    Davenport, Iowa
    Posts
    2,385
    Thanks
    100
    Thanked 113 Times in 111 Posts

    Default answer :)

    I found the answer in this thread.

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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •