www.webdeveloper.com
Results 1 to 5 of 5

Thread: Why does IE display all margins and paddings larger than other browsers?

  1. #1
    Join Date
    Mar 2010
    Posts
    701

    Why does IE display all margins and paddings larger than other browsers?

    If I had div{margin-top:100px;}, it would be further from the top in IE than in any other browsers. Are there any workarounds?

  2. #2
    Join Date
    Aug 2006
    Posts
    1,909
    Any chance that div is inside another block where you haven't set the margins? Default margins and padding are not the same in all browsers, so you either need to explicitly set them to something, or make a global setting like:
    Code:
    * {margin:0;padding:0}
    Dave

  3. #3
    Join Date
    Mar 2010
    Posts
    701
    Yes, I have that.

    For example, #login input[type="submit"]{padding:0 5px;} barely makes a difference in Chrome/FF but it makes the button look big and fat in IE.

  4. #4
    Join Date
    Aug 2006
    Posts
    1,909
    Are you talking about page margins or button sizes? Do you have an example I could see?

    Dave

  5. #5
    Join Date
    Jul 2009
    Posts
    184
    Have you tried this at the beginning of your stylesheet to reset margins and padding?
    Code:
    * {
         margin: 0px;
         padding: 0px;
    }
    If so, what about trying something like Eric Meyers reset stylesheet, which should almost eliminate cross browser css issues.

    To answer your question in the title: IE treats the CSS Box model differently than other browsers by default. Such a PITA sometimes.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles