Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

centered page in a main div

Status
Not open for further replies.

imstillatwork

IS-IT--Management
Sep 26, 2001
1,605
US
I have a web site I'm working on (
It is a main div centered. It works for me in firefox and IE 5 and 6.

I was trying to center the main div on a new web project and could not. I even went as far as copying my nwtec.com code to my new project and it would NOT work. It sits on the left.


The only difference is the servers they reside on. What gives?
 
Works for me in Mozilla. IE barfs up. IE5 shouldn't work with both codes, since it doesn't understand the margin: auto; command. IE6 apparently thinks it is in quirks mode with the second page and standards mode in the first. Remove the comment from the top. Doctype should be the first thing in the document and while a comment should make no difference, IE could be using that as an excuse.
 

I'll second that. With a comment (or pretty much anything, for that matter) above a valid DOCTYPE, IE seems to ignore the DOCTYPE.

I found this out last week - such an annoying problem as well, as I normally put comments and to-do stuff abobve everything else. Ah well!

Dan


[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
[banghead]

 
Sooo....Whats the sure fire way to center a div in EI5,6 and FF?



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top