By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,204 Members | 1,360 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,204 IT Pros & Developers. It's quick & easy.

center the page

P: n/a
Hi,
simpe question: How do I center the page (everything between <bodyand
</body>)?
I tried using margin but it depends on the screen resolution,
text-align seems to center everything, including the texts.

Thanks.

Sep 20 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
as*******@hotmail.com wrote:
Hi, simpe question: How do I center the page (everything between
<bodyand </body>)?
body { margin: 0 auto; width: 80%;}

If you meant "centered text", like this:

Volutpat duis minim tation eum molestie dolor ea ut. Te
dolor wisi. Accumsan eum et consectetuer illum eu
exerci nisl in euismod vulputate. Nulla duis, in vulputate,
minim odio ad, qui diam nulla at qui. Esse quis laoreet
sed, ut feugait molestie consequat iusto, in nostrud zzril
tincidunt consequat et zzril feugait ullamcorper
erat euismod.

...well, don't do that. It's extremely hard to read because the eye must
hunt for the beginning of the new line.
I tried using margin but it depends on the screen resolution,
text-align seems to center everything, including the texts.
Nothing on web pages depends on screen resolution, everything depends on
browser window width. Not everyone has a maximized browser.

--
-bts
-Motorcycles defy gravity; cars just suck.
Sep 20 '06 #2

P: n/a
On 2006-09-20, as*******@hotmail.com wrote:
Hi,
simpe question: How do I center the page (everything between <bodyand
</body>)?
I tried using margin but it depends on the screen resolution,
text-align seems to center everything, including the texts.
body {
width: 80%; /* adjust to taste; do not use fixed px width */
margin: auto;
}

--
Chris F.A. Johnson <http://cfaj.freeshell.org>
================================================== =================
Author:
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
Sep 20 '06 #3

P: n/a

Chris F.A. Johnson wrote:
On 2006-09-20, as*******@hotmail.com wrote:
Hi,
simpe question: How do I center the page (everything between <bodyand
</body>)?
I tried using margin but it depends on the screen resolution,
text-align seems to center everything, including the texts.

body {
width: 80%; /* adjust to taste; do not use fixed px width */
margin: auto;
}

--
Chris F.A. Johnson <http://cfaj.freeshell.org>
================================================== =================
Author:
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
Thanks a lot.

Sep 20 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.