homepage Welcome to WebmasterWorld Guest from 54.205.52.110
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Browsers / Firefox Browser Usage and Support
Forum Library, Charter, Moderators: incrediBILL

Firefox Browser Usage and Support Forum

    
div will not centrally align in IE
(works fine in firefox)
FloppyCopy




msg:1588960
 8:34 pm on Nov 15, 2004 (gmt 0)

On my personal website, the layout is dominated by a div tag that fixes the page's width and centrally aligns it, among others. Here's the code for the div:

<div style="border: 1px #fff solid; background: #000; margin: auto; padding: 10px; width: 750px;">

And, as I understand, the 'margin: auto;' attribute is what centrally aligns the whole div. (and it works fine in IE, Firefox, and Opera)

However, I have forums (powered by XMB) installed on my site as well, in an appropriate directory. I also have the div tag placed there in order to keep the site looking relatively the same:

<div style="border: 1px #fff solid; background: #000; margin: auto; padding: 10px; width: 750px;">

BUT - the forums section aligns centrally in Firefox and Opera, but NOT in IE. I can't for the life of me figure out why, and I've tried a plethora of ways to fix it.

Anyone have any insight?

 

SuzyUK




msg:1588961
 8:43 pm on Nov 15, 2004 (gmt 0)

Hi FloppyCopy - Welcome to WebmasterWorld

IE does not support the margin: 0 auto; method of centering it still requires "text-align: center;" but that needs to be on the parent element so

body {text-align: center;}

div {text-align: left; margin: 0 auto; width: 750px;}

should do it.. or whatever your parent element is for that div, note setting the actual text alignment back the default may be required in your div

Suzy

FloppyCopy




msg:1588962
 8:50 pm on Nov 15, 2004 (gmt 0)

Wow, that was easy enough. Thanks so much.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Browsers / Firefox Browser Usage and Support
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved