SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Dec 2004
    Location
    portland
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    IE Positioning problem

    Hi.

    I have problem positioning a right nav container in IE. It works ok in firefox.

    http://www.hawaiiactive.com/warren/c...um=Act_Num=110

    The css involved is

    #rightnav
    {
    position: absolute;
    top: 120px;
    margin-left: 610px;
    margin-right: 10px;
    background: #ffcc00;
    width: 120px;
    }


    Why is IE so wide to the right?

    thanks

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

    You haven't supplied any positioning so the margin-left is taking effect from where ie thinks the element is.

    You need to set position:relative on the main container to set astacking context and then the following code should be effective.

    Code:
    #container
    {
    width: 740px;
    text-align: left;  
    margin: -10px auto;
    background: #ffcc00;
    color: #333;
    line-height: 130%;
    position:relative;
    }
    #rightnav
    {
    position: absolute;
    top: 120px;
    right:10px;
    background: #ffcc00;
    width: 120px;
    }
    Hope that helps.


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
  •