Jump to content

Centering everything on a page


starvator

Recommended Posts

I want to center everything on my site, without making the text centered on the page.  I want the content to stay the same, but as if i took a picture of the site and put it in the middle of my screen.  Is there a way to do this?

 

If it helps, my site is http://youtubegiveaways.herobo.com

Link to comment
https://forums.phpfreaks.com/topic/207304-centering-everything-on-a-page/
Share on other sites

You don't need to bump your thread after an hour and a half. Wait a day or so.

 

Wrap all your content in a div with an ID of wrapper:

 

<div id="wrapper">
// your current content here
</div>

 

Add the following to your CSS:

#wrapper
{
  width:800px; // set this to the current width of your site
  margin:0 auto;
}

That's the basics, You are on your own for the fine tuning.

You don't need to bump your thread after an hour and a half. Wait a day or so.

 

Wrap all your content in a div with an ID of wrapper:

 

<div id="wrapper">
// your current content here
</div>

 

Add the following to your CSS:

#wrapper
{
  width:800px; // set this to the current width of your site
  margin:0 auto;
}

That's the basics, You are on your own for the fine tuning.

 

I did that, my style looks like this

/* Page styles */

body,h1,h2,h3,p,td,quote,small,form,input,ul,li,ol,label{
margin:0px;
padding:0px;
}

body{
margin-top:20px;
font-family:Arial, Helvetica, sans-serif;
color:51555c;
height:100%;
font-size:12px;
}

/* Navigation menu styles */

ul{
height:25px;
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
}

ul li{
border:1px solid #444444;
display:inline-block;
float:left;
height:25px;
list-style-type:none;
overflow:hidden;
}

ul li a, ul li a:hover, 
ul li a:visited{
text-decoration:none;
}

.normalMenu, .normalMenu:visited,
.hoverMenu, .hoverMenu:visited,
.selectedMenu,.selectedMenu:visited {
outline:none;
padding:5px 10px;
display:block;
}

.hoverMenu,.hoverMenu:visited,
.selectedMenu,.selectedMenu:visited {
margin-top:-25px;
background:url(img/grey_bg.gif) repeat-x #eeeeee;
color:#444444;
}

.selectedMenu,.selectedMenu:visited {
margin:0;
}

.normalMenu, .normalMenu:visited{
color:white;
background:url(img/dark_bg.gif) repeat-x #444444;
}

#wrapper
{
  width:800px; // set this to the current width of your site
  margin:0 auto;
}

and i put <div id="wrapper"> right under the body tag and </div> before closing th body tag... it dosnt work...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.