How do you make Dreamweaver Layers stay in place in IE?

Discussion in 'Web Design and Development' started by nimbuscloud, Dec 9, 2007.

  1. nimbuscloud macrumors regular

    Joined:
    Jul 9, 2007
    #1
    Hello all,

    I wanted to know how do you make Dreamweaver Layers stay in place in Internet Explorer. I can make the site align to the left side of the browser, but I would like to have it centered. Dreamweaver Layers work in Safari, Firefox, and so...but Internet Explorer won't let them stay in place properly.

    Anyone know how to fix that...without left aligning the website?

    Thanks, any help will do.

    :apple:
     
  2. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #2
    Well most browsers will center an element that has the CSS margin: 0 auto; where the auto is applied to the left and right side and causes the element to be centered. IE doesn't follow this. For IE you have to use text-align: center; on the parent element. This can generally be done on the body element then if you have a container div that surrounds the whole content you can change the text-align back to left. It's a common workaround.
     
  3. nimbuscloud thread starter macrumors regular

    Joined:
    Jul 9, 2007
    #3
    When you talk about "div that surrounds the whole content", do you mean a Layers within a Layer (like navigation drop down layers within a big layer)?

    I'm sorry, I'm not as experienced.

    :apple:
     
  4. Stampyhead macrumors 68020

    Stampyhead

    Joined:
    Sep 3, 2004
    Location:
    London, UK
    #4
    It would help if you could include a link to the page that's not working as well as the offending code. That would make it a bit easier to offer some suggestions.
     
  5. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #5
    Not exactly. I should have explained further, but was getting ready for work. You want to use a layer as a base for the page.

    Like so,
    HTML:
    ...
    <body>
    <div id="container">
    
    ... Your HTML code here ...
    
    </div>
    </body></html>
    Then, part of your CSS would be,
    Code:
    body {
     text-align: center;
    }
    #container {
     margin: 0 auto;
     text-align: left;
    }
    Edit:
    Though, looking at my own code for my web site I just use the margin: 0 auto; and that seems to be working in IE6. So I'd suggest just using that part for the moment to see if it fixes, then if need be try the other parts I suggested.
     
  6. nimbuscloud thread starter macrumors regular

    Joined:
    Jul 9, 2007

Share This Page