SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Addict frankiehots's Avatar
    Join Date
    Jan 2002
    Location
    U.S.A. *Blue State*
    Posts
    289
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Negative margin works in FF, not in IE

    I thought had the handling for most negative margin tricks down pat, but I guess not. The navigation on this page works exactly as it should in Firefox, but gets cut off in IE6.

    The desired effect is that the "active" page has a 5 px red line indicator under it's name. The red line should be half in the black and half in the gray area (which is part of the #middle div). Also In IE6, my #middle div is getting pushed down a couple of pixels, leading to a black line sticking out on the left.

    Here is a link to the stylesheet

    I followed the advice from this thread

    Anyone have an idea where I am going wrong?

  2. #2
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,346
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    The problem is that ie will always stretch a parent container to hold its content. Therefore you cannot make an element stick out of its parent container using that method.

    You have to outsmart IE and do this instead.

    Code:
    #topnav {
        position: relative; 
     top:75px;
        height: 26px;
        width: 500px;
        font-weight: bold;
        float: right;
        padding: 0;
        margin:0;
        list-style-type:none;
        font-family: Arial, Helvetica, sans-serif;
        font-size: 12px;
        }
    That works for me

  3. #3
    SitePoint Addict frankiehots's Avatar
    Join Date
    Jan 2002
    Location
    U.S.A. *Blue State*
    Posts
    289
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I swapped out your #topnav properties in place of mine, but I still get the exact same result. Am I missing something else?

  4. #4
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,346
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Sorry I forgot to mention I also added this

    Code:
    #header img {display:block}

  5. #5
    SitePoint Addict frankiehots's Avatar
    Join Date
    Jan 2002
    Location
    U.S.A. *Blue State*
    Posts
    289
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That did it! Thanks a lot!


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
  •