Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: How to center page when opened by a hi res browser  (Read 3457 times)

0 Members and 1 Guest are viewing this topic.

jseliga

  • Guest
How to center page when opened by a hi res browser
« on: August 04, 2006, 07:54:29 AM »
I am learning how to build a Web page using HTML. Although I can use a Web tool that allows me to set the properties to center, I do not know how to do this in HTML. I designed my screen for 800X600 which looks fine, but when viewed with a higher resolution the page the contents are on the left. Note: although I can use  “Site Builder” to correct this problem, I want to do it in a Text file in HTML code.

Rob Pomeroy



    Prodigy

  • Systems Architect
  • Thanked: 124
    • Me
  • Experience: Expert
  • OS: Other
Re: How to center page when opened by a hi res bro
« Reply #1 on: August 04, 2006, 08:05:00 AM »
You could wrap anything you want centred in a single DIV:
<div align='center'>
 Blah blah
 </div>

Or you could use CSS:
<###style>
body
{
   margin-left: auto;
   margin-right: auto;
}
<###/style>

(Remove the '###'.)  Not sure all browsers will correctly handle that CSS though.
« Last Edit: August 04, 2006, 08:06:17 AM by robpomeroy »
Only able to visit the forums sporadically, sorry.

Geek & Dummy - honest news, reviews and howtos

jseliga

  • Guest
Re: How to center page when opened by a hi res bro
« Reply #2 on: August 04, 2006, 10:38:22 AM »
Thanks, Rob the <div align='center'>   Blah blah   </div> worked and was simple.

Rob Pomeroy



    Prodigy

  • Systems Architect
  • Thanked: 124
    • Me
  • Experience: Expert
  • OS: Other
Re: How to center page when opened by a hi res bro
« Reply #3 on: August 04, 2006, 01:47:56 PM »
Great.  Job done.  :)
Only able to visit the forums sporadically, sorry.

Geek & Dummy - honest news, reviews and howtos