Grow your CSS skills. Land your dream job.

Resolved – IE rendering incorrectly – PLS HELP

  • # November 30, 2008 at 8:30 pm

    Hi folks… this is the situ, i have a site built on a mac using DW. viewing through firefox, opera and safari on the mac everything displays as it should. On the PC firefox and safari and opera also display correctly, but good ol IE puts the header background along with the content underneath the header.

    the site is here http://www.wigglytail.com.au/v2

    Any thoughts, ideas much appreciated

    Cheers

    Heres the code:

    Code:
    @charset “UTF-8″;
    body {
    margin: 0; /* it’s good practice to zero the margin and padding of the body element to account for differing browser defaults */
    padding: 0;
    text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */
    color: #ffffff;
    background-image: url(images/wigbg.jpg);
    font-family: Arial, Helvetica, sans-serif;
    color:#216db6;
    font-size:12px;
    background-color: #ffffff;
    background-repeat: repeat-x;
    }
    .twoColFixLtHdr #container {
    width: 780px; /* using 20px less than a full 800px width allows for browser chrome and avoids a horizontal scroll bar */
    background: #FFFFFF;
    margin: 0 auto; /* the auto margins (in conjunction with a width) center the page */
    border: 3px solid #00adef;
    text-align: left; /* this overrides the text-align: center on the body element. */
    }
    .twoColFixLtHdr #header {
    background: #DDDDDD;
    padding: 0 10px 0 20px; /* this padding matches the left alignment of the elements in the divs that appear beneath it. If an image is used in the #header instead of text, you may want to remove the padding. */
    background-image: url(images/headerBG.png);
    height: 252px;
    }
    .twoColFixLtHdr #header h1 {
    margin: 0; /* zeroing the margin of the last element in the #header div will avoid margin collapse – an unexplainable space between divs. If the div has a border around it, this is not necessary as that also avoids the margin collapse */
    padding: 10px 0; /* using padding instead of margin will allow you to keep the element away from the edges of the div */
    }
    .twoColFixLtHdr #sidebar1 {
    float: left; /* since this element is floated, a width must be given */
    width: 310px;
    padding-top: 15px;
    padding-right: 10px;
    padding-bottom: 15px;
    padding-left: 20px;
    border: 0px solid #000000;

    }
    .twoColFixLtHdr #mainContent {
    margin-top: 0;
    margin-right: 0;
    margin-bottom: 0;
    margin-left: 10px;
    padding-top: 0;
    padding-right: 20px;
    padding-bottom: 0;
    padding-left: 20px;
    float: left;
    width: 380px;
    border: 0px solid #000000;
    }
    .twoColFixLtHdr #footer {
    padding: 0 10px 0 20px; /* this padding matches the left alignment of the elements in the divs that appear above it. */
    background:#ffffff;
    text-align: center;

    }
    .twoColFixLtHdr #footer p {
    margin: 0; /* zeroing the margins of the first element in the footer will avoid the possibility of margin collapse – a space between divs */
    padding: 10px 0; /* padding on this element will create space, just as the the margin would have, without the margin collapse issue */
    }
    .fltrt { /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */
    float: right;
    margin-left: 8px;
    }
    .fltlft { /* this class can be used to float an element left in your page */
    float: left;
    margin-right: 8px;
    }
    .clearfloat { /* this class should be placed on a div or break element and should be the final element before the close of a container that should fully contain a float */
    clear:both;
    height:0;
    font-size: 1px;
    line-height: 0px;
    }

    /* Added elements */

    .eyecandy {
    width: 900px;
    margin: 0 auto; /* the auto margins (in conjunction with a width) center the page */
    border: 0px solid #000000;
    text-align: left; /* this overrides the text-align: center on the body element. */
    background-image: url(images/wigbgk.jpg);
    }

    .flower {
    width:880px;
    background-image:url(images/flowers.png);
    position: relative;
    top: 0px;
    height: 252px;
    left: 0px;
    overflow: hidden;
    z-index: 5;
    visibility: inherit;
    right: 150px;
    bottom: 0px;
    float: left;
    }

    .chalkboard {
    width:315px;
    height:344px;
    background-image:url(images/specials.png);
    overflow: hidden;
    position: relative;
    left: -30;
    font-family: ComicSans, Comic Sans, Comic Sans MS, Helvetica, sans-serif;
    }

    .ChalkText {
    color: #FFFFFF;
    font-size: 16px;
    position: relative;
    left: 23px;
    z-index: 4;
    top: 120px;
    width: 270px;
    }

    .chook {
    width:164px;
    background-image:url(images/chook.png);
    position: relative;
    height: 260px;
    z-index: 5;
    visibility: visible;
    float: right;
    bottom: 0px;
    top: -30px;
    }

    .pig {
    width:134px;
    background-image:url(images/pig.png);
    position: relative;
    height: 260px;
    z-index: 5;
    visibility: visible;
    float: right;
    bottom: 0px;
    top: -30px;
    }

    .cow {
    width:154px;
    background-image:url(images/cow.png);
    position: relative;
    height: 260px;
    z-index: 5;
    visibility: visible;
    float: right;
    bottom: 0px;
    top: -30px;
    }

    .award {
    width:275px;
    background-image:url(images/award.png);
    position: relative;
    height: 298px;
    z-index: 5;
    visibility: visible;
    float: right;
    bottom: 0px;
    top: -20px;
    }

    /* Menu elements */

    .navigation {
    float:left;
    width: 430px;
    z-index: 8;
    margin-left: 400px;
    margin-top: 17px;
    }

    /* footer nav */
    .footnav li {
    display: inline;
    padding: 0px 10px 7px 16px;
    color: #216db6;
    }

    a, a:link, a:visited {
    color: #216db6;
    }

    /*jquery */
    #preview{
    position:absolute;
    /* border:1px solid #ccc; */
    /* background:#333; */
    padding:0px;
    display:none;
    color:#fff;
    }

    #tooltip{
    position:absolute;
    border:1px solid #333;
    background:#f7f5d1;
    padding:2px 5px;
    color:#333;
    display:none;
    }

    /* recipe */
    .recipe_title {

    font-size: 22px;

    color: #ff3366;

    font-family: Arial,Verdana,Helvetica,sans-serif;

    font-style: normal;

    }

    .recipeBody {

    font-size: 13px;

    color: #e85775;

    font-family: Arial,Verdana,Helvetica,sans-serif;

    line-height: 125%;

    }

    .recipe_bold {

    font-weight: bold;

    color: #ff3366;

    }

    /* nav */

    ul#sole-brands li {
    display:block;
    float:left;
    z-index:10;
    }
    ul#sole-brands li a {
    display:block;
    outline:none;
    width:80px;height:80px;
    background:transparent url(brand-nav.png) no-repeat 0 0;
    text-indent:-9009px;
    margin:0 0 0 0;
    }

    ul#sole-brands li a:hover {background-position:0 -80px}

    ul#sole-brands li#home-nav a {
    width:37px;
    background-position:-15px 0;
    }
    ul#sole-brands li#home-nav a:hover {
    background-position:-15px -50px
    }
    ul#sole-brands li#about-nav a {
    width:42px;
    background-position:-52px 0;
    }
    ul#sole-brands li#about-nav a:hover {
    background-position:-52px -52px
    }
    ul#sole-brands li#locations-nav a {
    width:57px;
    background-position:-94px 0;
    }
    ul#sole-brands li#locations-nav a:hover {
    background-position:-94px -52px
    }
    ul#sole-brands li#recipes-nav a {
    width:60px;
    background-position:-150px 0;
    }
    ul#sole-brands li#recipes-nav a:hover {
    background-position:-150px -52px
    }
    ul#sole-brands li#contact-nav a {
    width:45px;
    background-position:-220px 0;
    }
    ul#sole-brands li#contact-nav a:hover {
    background-position:-220px -52px
    }
    ul#sole-brands li#delivery-nav a {
    width:42px;
    background-position:-280px 0;
    }
    ul#sole-brands li#delivery-nav a:hover {
    background-position:-280px -52px
    }
    ul#sole-brands li#wagyu-nav a {
    width:42px;
    background-position:-335px 0;
    }
    ul#sole-brands li#wagyu-nav a:hover {
    background-position:-335px -52px
    }
    ul#sole-brands li#tv-nav a {
    width:42px;
    background-position:-390px 0;
    }
    ul#sole-brands li#tv-nav a:hover {
    background-position:-390px -52px
    }

    and this is the HTML:

    Code:
    < !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">




    Main Content

    Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent aliquam, justo convallis luctus rutrum, erat nulla fermentum diam, at nonummy quam ante ac quam. Maecenas urna purus, fermentum id,


    < ?php
    $fp = fopen("uploads/specials.csv", "r");
    while (!feof ($fp)) {
    $contents[] = explode(";", fgets($fp, 4096));
    }
    fclose ($fp);

    echo "

    n”;
    foreach($contents as $row) {
    echo “

    n”;
    }
    echo ““;
    ?>




    # December 1, 2008 at 1:05 am

    did you clear the floats? When you apply float left or right, you need to clear the float otherwise the element below will move up to fill the space to the right or left of the floated element. I like this method. make a class like this

    .clear { clear: both; }

    then use it like this

    <div class="clear"></div>

    I think if you put that just before your wrapper, that might solve your problem. At this point, it’s just a guess.

    Rob
    # December 1, 2008 at 3:23 am

    are you checking it in IE6? I can not see the error in IE7.

    If its things being put behind things that shouldnt be then z-indexing possibly is the culpret.

    When you set a z-index, make sure you have set a position to the element – like "position:relative;" you will need this for the z-indexing to render properly. Also in IE, I have found that if you do not z-index your whole stack, so even the #header it can cause issues, as IE is in a world of its own… z-index:0; wont show up, so you might want to try z-indez:1; – if you set it to -1 you might find it disapears behind the container div. :mrgreen:

    # December 4, 2008 at 10:06 pm

    thanks for your thoughts guys.. after some fiddling it seems to be working now in 6 – 7 and 8 (according to browsershots that is)

    turns out that i’d forgotten to close a <div> which was upsetting it! ..

    Cheers
    Al

    Viewing 4 posts - 1 through 4 (of 4 total)

    You must be logged in to reply to this topic.

    Projects

    *May or may not contain any actual "CSS" or "Tricks".

    $row[0] $row[1]