Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Gap between divs in IE

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #24635
    whitsey
    Participant

    Hoping someone can help with what I’m assuming is a simple fix (not other website seems to have this problem so clearly millions have figured it out before…)

    Below is how my css appears in IE only – works fine in every other browser.

    [img]http://alternet.com.au/ie_problem.png[/img]

    Here is the html:

    Code:

    Here is the css:

    Code:
    @charset “utf-8”;
    * {
    margin: 0;
    padding: 0;
    }
    #body {
    font-size: 62.5%;
    background-image: url(../images/background.png);
    font-family: “Trebuchet MS”, Arial, Helvetica, sans-serif;
    }

    .clear { clear:both; }

    #container_bg {
    margin: 0 auto;
    width: 919px;
    }
    #main_bg_top {
    background-image: url(../images/bg_top.gif);
    background-repeat: no-repeat;
    width:919px;
    height:7px;
    margin-top: 10px;
    }
    #main_bg_body {
    background-color: #e6e6e6;
    width:909px;
    padding: 5px;
    }
    #header {
    width: 899px;
    margin: 0 auto;
    }
    #header_top {
    background-image: url(../images/bg_header_top.gif);
    background-repeat: no-repeat;
    width: 899px;
    height: 6px;
    }
    #header_body {
    width: 887px;
    background-color: #FFF;
    border-right: solid #999999 1px;
    border-left: solid #999999 1px;
    padding: 5px;
    }
    #header_bottom {
    background-image: url(../images/bg_header_bottom.gif);
    background-repeat: no-repeat;
    width: 899px;
    height: 7px;
    }
    #main_bg_bottom {
    background-image: url(../images/bg_bottom.gif);
    background-repeat: no-repeat;
    float: left;
    width:919px;
    height:7px;
    }

    Thanks

    #56520
    darkkiller
    Member

    You need edit top background:
    background: url(link) no-repeat bottom;
    :D

    #56523
    apostrophe
    Participant

    Try removing the padding from #main_bg_body and #header_body and applying it to the content of those divs instead.

    #56539
    whitsey
    Participant
    "darkkiller" wrote:
    You need edit top background:
    background: url(link) no-repeat bottom;
    :D

    Thanks darkkiller, that works which I had toyed with however, can anyone explain why IE does this? I have given that div a specific height of 7px yet clearly IE has rendered the div to be much higher than that.

    Do divs in IE have to be a minimum height?

    Thanks

    #56558
    whitsey
    Participant
    "apostrophe" wrote:
    Try removing the padding from #main_bg_body and #header_body and applying it to the content of those divs instead.

    Thanks apostrophe, that did not work however I have found the fix… I need to set the font-size to 0 as IE auto-sizes teh div based on the font-size…

Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘CSS’ is closed to new topics and replies.