- From: Tantek Celik <tantek@cs.stanford.edu>
- Date: Thu, 25 Oct 2001 10:43:10 -0700
- To: "Håkon Wium Lie" <howcome@opera.com>, Andrew McFarland <andrew.mcfarland@unite.net>
- CC: "www-style@w3.org" <www-style@w3.org>
From: Håkon Wium Lie <howcome@opera.com> Subject: Re: Re:Re: How is it possible to devise such a feeble system? Date: Wed, Oct 24, 2001, 4:51 PM > Also sprach Andrew McFarland: > > > What you are wanting to do is center the text vertically in the middle of > > the screen (or window). I don't think CSS `knows' what size the screen (or > > window) is. > > MOst of the CSS formatting model deals with elements (and their > associated boxes) and not the viewport (a.k.a. window). There is one > exeption, though. "Fixed positioning" lets you place elements w.r.t > the viewport. Here is a simple example on how to "center" content in > the window: > > <HTML> > <STYLE> > #foo { > position: fixed; > top: 40%; > height: 20%; > width: 100%; > text-align: center; > } > </STYLE> > <BODY> > <DIV id="foo"> > bar > </DIV> > </BODY> > > "Fixed positioning is supported by Opera and Mozilla. And IE5/Mac of course. ;-) Tantek P.S. In answer to the rhetorical question in the subject line which started this thread - it is possible to devise such a feeble system (I presume this is referring to CSS2's lack of vertical block centering) when version two of a standard becomes a recommendation before version one is even fully implemented. The "web developer" audience who would choose to point out that the emperor had no clothes in this case were too busy with working with what little CSS1 they could work with to bother giving CSS2 a critical look. This is another reason why no draft should exit CR without _at_least_ two interoperable (passing the respective test suite in the same way) implementations (available, shipping, not experimental) for every feature in that draft. Just look at http://w3.org/TR/ to see how many RECs there are that never met this criteria. ---------------------------------------------------------------------------- Browse Different. http://www.microsoft.com/mac/ie/
Received on Thursday, 25 October 2001 14:04:27 UTC