General Community > HTML/CSS

centering ellements using css?

<< < (3/4) > >>

Joel:
I should warn you, however, that IE5 won't like it. Luckily, though, it screws up the CSS standard by horizontally aligning both inline and block elements with text-align. So you'll want to add the following to your stylesheet (I updated the previously linked example to account for this):


--- Code: ---body { text-align: center; }
body * { text-align: left }

--- End code ---

SparkieGeek:
minor point: the width is 70% not 90%, I was a little scared when it claimed to be 90% wide... :)

Seph|roth:

--- Quote from: [Unknown] on August 04, 2003, 03:06:13 PM ---That's something I've always felt was missing from CSS 2.  There's no vertical align and the horizontal one is "text-align" which doesn't fit everything...

-[Unknown]

--- End quote ---
No vertical align? and what about the property verical-align ?

[Unknown]:
I'll eat my hat.  I swear I'd looked for that before and not found it.

-[Unknown]

Seph|roth:
here ya go

http://www.w3.org/TR/REC-CSS2/propidx.html

or

http://www.w3.org/TR/REC-CSS2/visudet.html#propdef-vertical-align

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version