Sent by Gee, David on 22 June 2004 14:02
-----Original Message-----
Nice troll, I'll bite. CSS2 supports vertical centering just fine via
display:table-cell; vertical-align:middle, which works in most modern
non-IE browsers.
Techniques like the new negative-margin float article in ALA [1] show
that we still haven't discovered all that can be done with these old
1998 specs...when browser makers bother to implement them.
[1] http://alistapart.com/articles/negativemargins/
---End Original Message---
These are hacks, not basic CSS functionality. Just take a look at some
of the articles that have been posted. Look, I can vertically center
content in a DIV far more reliably using Javascript than any of the CSS
hacks posted so far - it doesn't change the fact that this *extremely
basic* design concept is not supported by CSS in an intuitive manner.
Here's the way I see it - CSS has two components, "presentation" and
"layout". Presentation covers all the stuff like font settings, borders,
list-styles, etc. Layout covers the float model, absolute/relative
positioning, and the box model. The presentation part of CSS is great.
Works like a charm, degrades gracefully in most cases, the only real
shortcoming is the lack of a way to force text-wrapping for long
unbroken strings (although IE supports this with a proprietry property).
The "layout" part of CSS is a horrible, broken mess. The box model is
probably the only part that makes any kind of sense at all, and I still
believe that the broken IE5/quirks implementation is far more intuitive
to the novice user. The float model is like something out of Bizarro
world - a classic case of designing for edge cases. Yes, I know *why*
floated blocks "escape" their parent containers. It still makes no sense
for the majority of real-world designs. Take a look at the discussions
on this list. The vast majority are going over arcane hacks to
accommodate the byzantine layout logic of CSS. This list gets far more
traffic than any other web development/design list I'm subscribed to.
I've used the display:table-cell hack before. It's a hack. You lose a
lot of control over the element when you do this. For example, if the
element being displayed using "table-cell" style is contained within an
element with "text-align:right", it will still render at the left of the
container. Strictly speaking, this shouldn't be valid CSS. Any element
with "display:table-cell" should have a parent with "display:table-row",
which should in turn have a parent with "display:table".
Trollingly yours,
David
______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/