0
margin-left:auto;
margin-right:auto;

is working in firefox but not working in ie can someone help plz i want to center the page .

Edited by peter_budo: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks)

6
Contributors
12
Replies
13
Views
7 Years
Discussion Span
Last Post by Labhrainn Aemi
0

As long as the div you're attempting to center has a static width, IE6+ shouldn't have a problem with auto.

Perhaps if you provided a URL, or code snippets, we'd be able to better help you.

0

As long as the div you're attempting to center has a static width, IE6+ shouldn't have a problem with auto.

Perhaps if you provided a URL, or code snippets, we'd be able to better help you.

thx man i found the problem it was from the doctype of the html

0

Interesting, so was IE6 in quirks then? Out of curiosity, what was your previous (problematic) doctype?

0

To center a page you should use this CSS

#header {
        margin: 0 auto;
}
#wrapper {
       margin: 0 auto;
}
#footer {
       margin: 0 auto;
}

This >>> margin: 0 auto; <<< Will center whatever CCS section its in. If you want something to move left or right then you replace this with the

float: left;

or

float: right;

elements.

Hope this helps.

I am a Web Developer and all the developers I know use this software. Its Open Source (Free) and shows you bugs in all Internet Explorer from IE5, 6, 7 & 8

Its called IETester and you can download it from here >>> IETester

Edited by Wrams: n/a

0

Interesting, so was IE6 in quirks then? Out of curiosity, what was your previous (problematic) doctype?

i 4 get it i guess doctype1.0....

0

Right click on your websites homepage or where ever the problem lies and then select View Source then go right to the top and copy the code Doctype Decleration here.

That way we can see if its got a mis type or something.

0

Right click on your websites homepage or where ever the problem lies and then select View Source then go right to the top and copy the code Doctype Decleration here.

That way we can see if its got a mis type or something.

i closed it without saving so i can't get it.

0

You have access to his website? The thing is where trying to help but as of yet he has not give us any coding what-so-ever. So where fighting an uphill battle trying to sort out a site with no information. Impossible I think!

If you can provide us with some sort of coding we can help sort this issue out so that if it happens again you will know exactly what to do to sort this problem out.

Surely you have access to the website...? Whats your websites URL? Just paste it in here so we can view the source ourselves and figure out any bugs or glitches. They don't mind you posting your web site in the forums as long as it's for help and not spamming.

0

'margin' auto needs DOC type in IE. And what is your code. If you don't show your code, we can't find what the problem is. So, post your code. Insert the doc type in your html first. Try this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1.dtd">

If it not ok, post your code here.

0
img.right { float: left; margin: 0 10px 10px 0; }
div.clear { display: block; height: 0; clear: both; }

Make sure you add <div class="clear"></div> afterwards or it could mess up any other floats you may have on your page.
<FAKE SIGNATURE>

Edited by peter_budo: Keep It On The Site - Do not manually post &quot;fake&quot; signatures in your posts.Ccreate a signature within the user control panel.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.