473,387 Members | 1,687 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

center the page

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
3 1820
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
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

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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: john T | last post by:
Is there anyway to vertically center a html table using css in such a way it does not alter the html table. When I tryied it just screws up.
3
by: Jennifer | last post by:
I have a page with three divs (top, left and center). I want to place hyperlinks in the left column (div), where each link calls a separate page. I want each separate page to open in the center...
2
by: googley | last post by:
I'm starting a new thread for a problem that I ran into.. I'm trying to use STYLE SHEETS/CSS to update multiple table widths across many pages. I did get it working with one small problem that...
7
by: Sean | last post by:
Hi, I have a tab control containing few tab pages. On each tab pages, I put an image on the tab page's title bar (the area on top of a tab page, ie where tooltip will appear). If i put both...
7
by: ALI-R | last post by:
Hi All, I have two user controls (header and footer) ,,which I've placed in an HTML Table in a page.I set the **align="center"** in the table and the table still is on the left side of the page...
7
by: charlies224 | last post by:
Hi, I have been searching for a way to display my whole web page at the center of the browser. Basically, I created a web application and created a web form with a table in it. I tried the...
1
by: judacris | last post by:
I've seen the threads here about molding 2 divs in a centered fashion. but I can't seem to solve this thing. my blogger blog is functioning well on my site for now, but the blog feed (left) and...
24
by: GloStix | last post by:
I'm trying to center this banner, it's in a div that has the same width so it's not exactly "centering" but it's screwed up, It works in safari but in Firefox it's messed up. I uploaded a Video to...
14
by: gaijinco | last post by:
I was a hobbist web coder for years but I had to sidestep for a while. Now I'm trying to return to it and I'm trying to clarify how am I supposed to do somethings with CSS v.s. HTML and I'm...
0
by: Yoav | last post by:
Hello, I have been trying to enter SQL statmenbts to DB2 control center command line. I saw that user "Thames" wrote to you: > I have to repost my question for help. > > Yesterday I set up two...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.