HTML/CSS help! center page!

zCypher

Diamond Member
Aug 18, 2002
6,115
171
116
Literacy Unlimited

Notice the page is all the way on the left. I need to center it. How can I do this? The site was designed using CSS and regardless of everything I've tried it's staying on the left. Any tips/ideas?
 

stndn

Golden Member
Mar 10, 2001
1,886
0
0
well, first, unless my eyes are deceiving me (it's about midnight after all), i don't see anything that says to center the texts ...

also, i looked at your css file, all the tags (or whatever those rules are called -- i forgot) use absolute positioning, with certain left position (pixels)

try removing the absolute positioning, and then try the <center> tag ...
or make the text-align:center;

or maybe someone else can shed some light to it as well....
 

dukdukgoos

Golden Member
Dec 1, 1999
1,319
0
76
Just assign left and right margins to your divs (margin-left: 20%;margin-right: 20%). Your main content area will need to be flexible to (60%, for example).
 

CalebTG

Senior member
Mar 29, 2000
624
0
0
Personally, I'd take the easy way out and and put everything in one centered table (a table with 1 row and 1 column) with no border. Might need to set a max width to avoid wrapping.
 

Barnaby W. Füi

Elite Member
Aug 14, 2001
12,343
0
0
Originally posted by: CalebTG
Personally, I'd take the easy way out and and put everything in one centered table (a table with 1 row and 1 column) with no border. Might need to set a max width to avoid wrapping.

i would call that the 1997-style way out.

one of the main purposes of using css is to seperate content from formatting, and get all visual elements out of the html, and let it be pure markup of *content*, allowing the css to handle the colors and layout and whatnot.

what this means is ditching <b>, <tables> (for layout, not tabular data), <center>, <font>, etc. if i decided to tomorrow, i could totally change the look of my site, just by editing the css file. if i was using <center>s and <font>s and markup like that, it would take anywhere from a few minutes (small site), to an hour or so, or a few hours (medium site), or even days or weeks (huge corporate site) to edit all of the html, which is spread out in many different files.

</webdorkrant>

like dukdukgoos said, just assign a margin % on each side of the body, and it will center down the midde.
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |