Jump to content

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...

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.