
January 30th, 2004
10:59 PM
thinking of something witty to put here
Status: Offline!
CSS/div FAQ
How do I make a div that stretches the height of the page (100% height)
This question is asked very often. The answer is at QuirksMode.
How do I horizontally center a div?
The code is relatively simple.
/* body can be replaced with the
parent of the object you want to center */
body {
text-align: center; /* IE5.x/Win fix */
}
#center {
text-align: left; /* reset text aligning */
margin: 0 auto; /* the correct way */
/* you can modify the top and bottom margins, just leave left and right to auto */
}
How do I vertically center a div?
This gets a little more complicated. The answer is at WPDFD (just ignore the stuff about horizontal centering)
Note: You must use a HTML doctype (not XHTML) or else it screws up IE5/Mac. Go figure. Update: You can use a hack to hide it from IE5/Mac. See below link.
How do I completely center a div
http://www.hicksdesign.co.uk/articles/css/vertical_centering_with_css/
How do I make a fluid header column? (Ynhockey
)
Easy. Just use float: left and the column magically shrinks to the size of the contents.
#elastic {
float: left;
}
How do I change scrollbar colors?
You don't. Actually, it's very possible, but not reccomended at all. Scrollbar colors annoy people, are non standards compliant, and are IE-only.
What's wrong with tables?
I won't go into depth, as this is a very big topic to discuss, and I'll just provide a short summary.
Tables weren't meant to be used for non-tubular data, so they shouldn't be. They also leave your pages unsemantic and unusable, which is a no no. You'll also be able to redesign your site with much more flexibility and speed.
Off Topic: How does your signature work?
My signature uses simple browser detection using PHP and reads the correct image based on the browser.
This will be updated further...
Last edited by Sykil, June 17th, 2005 04:02 AM (Edited 3 times)

January 31st, 2004
12:22 AM
Neversidian
Status: Offline!
This should be helpful! Thanks Radley!
___________________


February 7th, 2004
10:26 AM
Neverside Newbie
Status: Offline!
How do I vertically center a div?
This gets a little more complicated. The answer is at WPDFD (just ignore the stuff about horizontal centering)
this will only work on a mac if you use a:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
doctype - anything more and it fails

February 7th, 2004
11:41 AM
I'm the best and worst at everything !
Status: Offline!

February 7th, 2004
01:27 PM
Neverside Newbie
Status: Offline!
Originally posted by Mr.Kill
i dont get <div>'s 
is it just me?
What's there to "get" about them? A <div> is just a generic block level element. What you do with it with CSS might make it a little more confusing, though.
Just go through some CSS tutorials and you should get the hang of it, most of it is self explanatory. And, if you have any specific questions, just post a new thread.
// freak
___________________
Tables for layout is an abuse. -- Internet Explorer is unsafe.
Last edited by freak, March 14th, 2004 01:01 PM (Edited 1 times)

February 7th, 2004
04:50 PM
thinking of something witty to put here
Status: Offline!
Originally posted by reregistered
this will only work on a mac if you use a:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
doctype - anything more and it fails
I hadn't realized that at the start and I wasted a lot of time to figure out. Browsers are stupid.

February 7th, 2004
06:13 PM
with Mr. Jones
Status: Offline!
As requested... plus this is useful.
___________________
http://www.philbrodeur.com - Expert PHP Development and Tutorials

February 7th, 2004
06:16 PM
thinking of something witty to put here
Status: Offline!
Fixed the typo, thx jaded.

February 8th, 2004
06:40 PM
I have a question. Without tables, how can you make a layout where DIVs are next to each other?
Example:
_______________
| 1st div | 2nd div |
|______| _______|