Help centering Div layout

seventy1

New Member
I think I've cracked it! I added a DOCTYPE to the head of the coding and it seems to have fixed it.

"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">"
 

pingeyeg

New Member
I would never suggest using a transitional doctype. Always use strict; you will have much more flexibility, believe it or not, in your code. You may think not at the beginning, but this is how a website should be done.
 

conor

New Member
to make it work in all browsers use this

CSS

body{
text-align:center; <!--- for ie --->
}
#wrapper{
text-align:left;
margin:20px auto; <!--- for firefox and others --->
}

HTML

<body>

<div id="wrapper">

Have all of your content in here!

</div>

</body>

That should work in all browsers, let me know if you have any problems...
 
Top