starvator Posted July 9, 2010 Share Posted July 9, 2010 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 Quote Link to comment https://forums.phpfreaks.com/topic/207304-centering-everything-on-a-page/ Share on other sites More sharing options...
starvator Posted July 10, 2010 Author Share Posted July 10, 2010 bump? Quote Link to comment https://forums.phpfreaks.com/topic/207304-centering-everything-on-a-page/#findComment-1083875 Share on other sites More sharing options...
haku Posted July 10, 2010 Share Posted July 10, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/207304-centering-everything-on-a-page/#findComment-1083894 Share on other sites More sharing options...
starvator Posted July 10, 2010 Author Share Posted July 10, 2010 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... Quote Link to comment https://forums.phpfreaks.com/topic/207304-centering-everything-on-a-page/#findComment-1083922 Share on other sites More sharing options...
svanigiorgi Posted July 10, 2010 Share Posted July 10, 2010 <div class="center_content">yout text</div> .center_content { width:1008px; margin:auto; } it will necessarily fix it Quote Link to comment https://forums.phpfreaks.com/topic/207304-centering-everything-on-a-page/#findComment-1084213 Share on other sites More sharing options...
starvator Posted July 10, 2010 Author Share Posted July 10, 2010 u just used a giant table... it worked Quote Link to comment https://forums.phpfreaks.com/topic/207304-centering-everything-on-a-page/#findComment-1084214 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.