ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

IE width 100% issues. Help

December 11, 2008 6:15am

Subscribe [2]
  • #1 / Dec 11, 2008 6:15am

    Boxhead

    13 posts

    I’m trying to implement a 13px high bar that runs the full width of the browser window and sits on top of the following wrapper div. Works great in FF2 and 3 but in IE6 and 7 the bar begins at the left edge of the wrapper div then extends beyond the right edge of the wrapper div. Attached are 2 screenshots (one from FF2 - how I want it to look, and one fro IE7).

    Heres my code:

    XHTML

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
    <title>Test Page</title>
    <link rel='stylesheet' type='text/css' media='screen' href='test.css'>
    </head>
    <body>
    
    <div class="searchspan"></div>
    
    <div class="wrap"></div>
    
    </body>
    </html>

    and CSS

    body {
    background: #bbb;
    margin: 0;
    padding: 0;
    width: 100;
    }
    
    .searchspan {
    width:100%;
    height: 13px;
    background: url(top_image_a.png);
    background-repeat: repeat-x;
    position:absolute;
    
    }
    
    .wrap {
    width:902px;
    margin: 0 auto;
    height: 50px;
    border-left: 1px solid #dddddd;
    border-right: 1px solid #dddddd;
    border-bottom: 1px solid #dddddd;
    background-color: #fff;
    }

    Any ideas? Thanks!

  • #2 / Dec 11, 2008 8:04am

    Andy Harris

    958 posts

    Any chance you can pop a link to the page itself? I find it easier to debug stuff that way.

    You have width of 100 in your body CSS, is that a typo?

  • #3 / Dec 11, 2008 8:13am

    Boxhead

    13 posts

    yea the 100 in the body is a typo.

    Heres the link to the test page

    The code i posted is the only code for the page.
    Thanks

  • #4 / Dec 11, 2008 8:18am

    Andy Harris

    958 posts

    Reason for needing a link is that I use the dev tools on IE6 to tinker with the code so it’s easier to spot and fix it. I’m more than capable of looking at code all day and not spotting the most obvious problem!

    Anyway, it appears to fix it if you add ‘left:0’ to .searchspan. Is there a reason you’ve absolutely positioned it, as if not it doesn’t need to be and I think removing that would fix it too.

    EDIT// I just spotted why it’s absolutely positioned - duh!! 😊

  • #5 / Dec 11, 2008 8:23am

    Boxhead

    13 posts

    left: 0;
    Works a treat! Thanks so much!

    Have a nice day

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases