Page is a not externally linkable
- Code, Content, and Presentation
-- CSS
---- Vertical Center with CSS


Dabrowski - 11:13 am on Jun 1, 2007 (gmt 0)


Yep, but that's part of the discussion and learning, it's not like the question hasn't arisen before.

Whoa! That returns 985 results!

This is still a very weak area of CSS I'll agree, but it's not exactly *important* to be able to force this effect

You think? How often have you had a horizontal menu bar and wanted the links in the middle? I think that happens somewhere on most sites at some point! Obviously the line-height works fine for that, but the point is still valid.

Sometimes you need to hit a nail in with a wrench.

Yes, but are you sure you should be using a nail?

I once hit a nail with a cucumber. It made a mess. This is a mess.

The funny thing is, vertical centering is one of the very few areas where current CSS support just doesn't cut it compared to the old-school presentational HTML, which is still universally supported.

And it's not only vertical centering, consider trying to center a few blocks next to each other, each of different and unknown size, in an unknown sized container? I opted for a table in the end.

Suzy will remember this one!
[webmasterworld.com...]

it would seem a good idea to open a "<table> vs. <div> - which do you use, and why?" thread. I'm sure it will be lively.

I did. It was.
[webmasterworld.com...]

[edited by: Dabrowski at 11:14 am (utc) on June 1, 2007]


Thread source:: http://www.webmasterworld.com/css/3350566.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com