lillizzierae Posted May 20, 2008 Share Posted May 20, 2008 Hi.I should know this but for some reason it's not clicking in my brain!How do I center a website using css? Link to comment Share on other sites More sharing options...
Ingolme Posted May 20, 2008 Share Posted May 20, 2008 Put the whole website within a <div> with margin: 0 auto; and use text-align: center in the CSS for the body:Don't forget to give the <div> a fixed width.body { text-align: center;}#content { margin: 0 auto; width: 960px; }<html>......<body><div id="content">... Rest of the page</div></body></html> Link to comment Share on other sites More sharing options...
webflex Posted May 21, 2008 Share Posted May 21, 2008 Hi,Next time just use the search engine :)There is a lot of very good things here.Complements \o/ Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.