margin gap in ie7

Discussion in 'CSS' started by sudhakararaog, Feb 15, 2009.

  1. #1
    i am having a serious issue with ie 7 i really need help.

    i am using a center layout using 900px the center layout looks and works fine

    in all browsers except for ie7 i have used a border for the wrapper tag.
    what i have noticed only in the case of ie7 is the left border for the wrapper

    tag starts a few pixels 2px or 3px before compared to all other browsers and

    due to this in ie7 the right border ends a few pixels when compared to all

    other browsers. so if i can fix the left border the right border for the

    wrapper tag will adjust automatically.

    i am using a valid xhtml transitional document. following is my code.

    -------------------------------
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">

    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Background image</title>

    <style type="text/css">

    body {
    text-align: center;
    margin: 0;
    font-family: Verdana;
    font-size: 10px;
    }

    #wrapper {
    width: 900px;
    text-align: left;
    margin: 0 auto;
    border: 1px solid #ffff00;
    }

    p{
    margin: 0;
    padding: 0;
    }

    </style>

    </head>

    <body>

    <div id="wrapper">
    <p>Content </p>
    </div></body></html>

    -------------------------------
    can someone please tell me what the issue is and what the code should be. i

    would highly appreciate any help as this is an issue in ie7 and not in other

    browsers.

    thanks.
     
    sudhakararaog, Feb 15, 2009 IP
  2. wd_2k6

    wd_2k6 Peon

    Messages:
    1,740
    Likes Received:
    54
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I can't see the problem in IE7 it looks the same as in FF to me?
     
    wd_2k6, Feb 15, 2009 IP
  3. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #3
    Do keep in mind that IE provides a vertical scrollbar even when it's not needed. That will move everything left a bit.

    You can't get rid of IE's scrollbar, but you can force other browsers to add one. Do html{height:100.5%;}.

    cheers,

    gary
     
    kk5st, Feb 15, 2009 IP