Help - Search - Members - Calendar
Full Version: How To Center Your Website
Zymic Webmaster Forums > Web Design & Development > General Web Design Discussion
getcustomproduction.com
i want to center my website

i did a google search and ran into this code
"
<style type=”text/css”>
html, body, #wrapper {margin:0;padding:0;height:100%;text-align:center;}
#wrapper {margin:0 auto;vertical-align:middle;width:250px;}
</style>
"

but it didnt work...

any sugguestions...??

website is www.platinumtracks.vndv.com
IamShipon1988
If you want to center the layout (demo) you can achieve that by giving the body a specific width and setting the margin to be auto. In general the CSS code should look something like this
CODE
body {
    width: 800px;
    margin:0px auto;
}

Or if you want a box to be centered vertically, then you can do is set a top value to it. Sample code would be something like this for the css
CODE
#inner {
    position: relative;
    top: -50%;
} /* for explorer only */


And here's a really good way you can dead center your site. I found it really useful http://d-graff.de/fricca/center.html
getcustomproduction.com
the codes still didnt work...

my template was made off photo shop then sliced into tables if that helps..???

=/

http://platinumtracks.vndv.com/index.html

to get a lil more in depth...
i am using frontpage to edit my website....

the code works on the design tab but as son as i hit preview everything goes to left???
IamShipon1988
Well your url is not loading for me, not sure why. I would say without any preview, you are not using any containers. So add a container to your general html file and then give it a specific width and set it to margin: 0 auto;
MrTouz
post your code, it will be better of you post it so we can try to modify and make it work.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.