Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

nimbuscloud

macrumors regular
Original poster
Jul 9, 2007
158
0
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:
 
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.
 
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.

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:
 
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.
 
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:

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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.