...

View Full Version : 1 small question



visualarts
03-08-2004, 04:30 AM
I built a website that is 800px wide, how do i make it stay centered in other resolutions like 1024x768?

www.bluesfear.com <== thats what im talking about if im being to vague.

STDestiny
03-08-2004, 04:44 AM
<div align="center">
Your content
</div>

-Andrew

ronaldb66
03-08-2004, 10:48 AM
Since the align attribute is deprecated, from a separate-content-from-presentation point of view, the preferred method would be to specify margin-left: auto; margin-right; auto for the element containing your content (typically a div); since IE doesn't buy this, for it to play nice you can specify text-align: center for the element containing the container element (body?), then for the container element text alignment can be corrected again if needed.

mindlessLemming
03-08-2004, 11:29 AM
And just to make what ronald said a little more clear....


<body>
<div id="container">
.......current layout goes here.......
</div>
</body>
_________________________________
/*--------CSS-----------*/

body{text-align:center;}

#container{
margin:0 auto;
text-align: left;
}



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum