center content in 1024X768??

windows

Guest
Here's one for all you HTML wizards...(then again, it might be really easy and simple, shows how much I know!)...<br />
<br />
How can I center my content, so that when a person with a screen resolution of 1024 X 768 views a web site, it is centered on their screen, with equal amounts of blank space on the left and right side of the content?? It would be designed so it is centered in a screen of 800 X 600 resolution also, but you wouldn't be able to tell it was centered, because the content would take up this entire screen resolution.<br />
<br />
Currently, I only know how to design a page left aligned, and when viewed through a 800 X 600 it looks great : it takes up all the screens real estate. However, when viewed through a 1024 X 768 screen resolution, my design left aligns the content and leaves alot of blank space on the right hand side of the screen. I think this looks bad. <br />
<br />
Any ideas on how to center my content? It better not be so simple as to just encapsulate all my content in a <center> and </center> tag. <br />
<br />
Thanks for any help in advance!<!--content-->take a look at this link,the contents are centerd on any resolution you may see it.(provided the browser supports CSS1)<br />
<br />
<!-- m --><a class="postlink" href="http://68.145.35.86/skills/javascripts/UltimateFormValidator.html">http://68.145.35.86/skills/javascripts/ ... dator.html</a><!-- m --><!--content-->Khalid, that link is down for me, but I presume this is the CSS you meant:<br />
<br />
body { text-align: center; }<br />
<br />
Adam<!--content-->How can I implement CSS to center my content?? Any great tutorials you guys would know of?<!--content-->http://www.w3schools.com/css/default.asp<br />
<br />
(w3 schools to save the day LOL)<!--content-->And if you want to use that code quickly just use<br />
<br />
<style type="text/css"><br />
body { text-align: center; } <br />
</style><br />
<br />
<br />
in the head of your page<br />
<br />
dave<!--content-->Yes, check out the W3Schools tutorial.<br />
<br />
You can either apply this CSS in the tag, head or an external stylesheet.<br />
<br />
In the body tag: <body style="text-align: center"><br />
<br />
In the head:<br />
<style type="text/css"><br />
body { text-align: center; } <br />
</style><br />
<br />
In an external stylesheet (text file called something.css):<br />
body { text-align: center; } <br />
then link using this:<br />
<link rel="stylesheet" type="text/css" href=http://www.webdeveloper.com/forum/archive/index.php/"something.css"><br />
<br />
Adam<!--content-->
 
Back
Top