Really basic Noob question- centering page

Reply

Join Date: Oct 2008
Posts: 6
Reputation: jevvv is an unknown quantity at this point 
Solved Threads: 0
jevvv jevvv is offline Offline
Newbie Poster

Really basic Noob question- centering page

 
0
  #1
Jul 10th, 2009
I'm doing our site and the template I used looks nice on my old monitor, because it fits the screen. My new computer has a widescreen monitor and so now I see that the layout of the page has the page based on the left side of the monitor

How do I set it so the page centres in the monitor, whatever size is used? Isn't there a simple line that goes into the css to do this?

You can see it here: Mission Adventure
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 20
Reputation: zeusofolus is an unknown quantity at this point 
Solved Threads: 0
zeusofolus zeusofolus is offline Offline
Newbie Poster

Re: Really basic Noob question- centering page

 
0
  #2
Jul 10th, 2009
Setting the right and left page margins to auto will typically solve this problem. (this creates a even left and right margin with the remaining empty space left over on a larger monitor)

For example if your html is:

  1. <html>
  2. <body>
  3. <div id="container">
  4. <p>This is your page content</p>
  5. </div>
  6. </body>
  7. </html>

Then your css doc should be

  1. body {
  2. margins: auto;
  3. }
  4.  
  5. #container {
  6. width:760px;
  7. margins: auto;
  8. }

Hope this helps
Eric
Last edited by peter_budo; Jul 10th, 2009 at 5:39 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 6
Reputation: jevvv is an unknown quantity at this point 
Solved Threads: 0
jevvv jevvv is offline Offline
Newbie Poster

Re: Really basic Noob question- centering page

 
0
  #3
Jul 10th, 2009
Thanks Eric, I'll try that.

... off to tinker
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC