# Solved: Centered, Fluid Layout with HTML 4.0 Transitional Doctype



## hudey123 (Sep 19, 2007)

Hey gang. I'm working on an old site that has the following DOCTYPE:


```
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
```
Because of a grid control the site is using I cannot change this DOCTYPE.

I'm trying to figure out how to fluidly center the layout using CSS and viewing it in IE 8 or IE 7 - but I can't get it to center. It's just a one-column DIV with 2 columns inside of it, so all I need to do is figure out how to center the single DIV and have it move fluidly back and forth if the browser is resized. I'm currently just using:


```
margin-left: auto;
margin-right: auto;
```
Any idea what I should try??

Thanks!


----------



## hudey123 (Sep 19, 2007)

Got it!

Supposedly IE doesn't center properly using "auto" margins.

I fixed the problem by adding:


```
text-align: center
```
to the main BODY tag's CSS entry.


----------



## tex0gen (Jun 10, 2007)

You can also add the following into your CSS to completely center it in every browser..

* {
margin: 0 auto;
padding: 0;
}


~Also, add text-align: center;

into the

body {

}

In your CSS


----------

