SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot
    Join Date
    Jun 2006
    Posts
    186
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    CSS problem in IE6 (PC)

    Looks fine in firefox, but in IE6 the width of the menu expands to the same width as the header and pushes the sidebar way off the page.

    Here is my css code for two menus I have:

    #mainnav {
    float:left;
    width:100%;
    background:#DAE0D2 url("/tabnavimages/bg.gif")
    repeat-x bottom;
    font-size:93%;
    line-height:normal;

    }



    #mainnav ul {
    margin:0;
    padding:10px 10px 0;
    list-style:none;
    }
    #mainnav li {
    float:left;
    background:url("/tabnavimages/norm_left.gif")
    no-repeat left top;
    margin:0;
    padding:0 0 0 9px;
    }

    #mainnav a {
    float:left;
    display:block;
    background:url("/tabnavimages/norm_right.gif")
    no-repeat right top;
    padding:5px 15px 4px 6px;
    text-decoration:none;
    font-weight:bold;
    color:#765;
    }
    /* Commented Backslash Hack
    hides rule from IE5-Mac \*/
    #header a {float:none;}
    /* End IE5-Mac hack */

    #mainnav a:hover {
    color:#333;
    }




    #categorynav {
    float:left;
    width:100%;
    background:#DAE0D2;
    font-size:93%;
    line-height:normal;
    padding-left: 10px;
    padding-top: 8px;
    padding-bottom: 8px;
    }

    #categorynav ul {
    margin:0;
    padding:0;
    list-style:none;
    }

    #categorynav li {
    float:left;
    margin-right:10px;
    padding-right:0px;
    }

    #categorynav a {

    display:block;
    padding:0;
    text-decoration: none;

    }
    Last edited by gragland; Jun 30, 2006 at 21:42.

  2. #2
    SitePoint Wizard drhowarddrfine's Avatar
    Join Date
    Aug 2005
    Posts
    3,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You have a stray body tag sitting before the doctype. Anything before the doctype puts IE into quirks mode.

  3. #3
    SitePoint Zealot
    Join Date
    Jun 2006
    Posts
    186
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have that body tag at the top of all my php pages so that the nav knows which tab to highlight. Is there any way to not have IE go into quirks mode when theres that "stray body tag" up there?

  4. #4
    SitePoint Wizard Wolf_22's Avatar
    Join Date
    Jul 2005
    Posts
    1,714
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This isn't a quick fix by any means, but it may help you in the future...

    I looked at your source, and it looked as if your website could use a bit of a clean-up. I saw that you had various listed as being in a "strong" visual format. You might consider making your navigation into a <ul>, and then assigning various CSS to the <ul>'s and <li>'s. After that, keep in mind that "less is more" when using CSS. It took me awhile to come up with half-way efficient CSS code before actually making anything that was worth anything. Always use semantic markup (use a <ul> for a list menu, use <p>'s for actual content paragraphs, etc). I'm betting that the body tag before your doctype isn't a semantic method...


Bookmarks

Posting Permissions

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