Previous Message
Next Message

Re: [css-d] Centering vertically - is it possible?

Sent by Rijk van Geijtenbeek on 2 May 2002 10:10


On Thursday, May 02, 2002, Tuttle wrote:

> I reread my message, and realized that someone scanning it quickly might not 
> realize that I'm asking a question. So, I'll rephrase:

> Is it possible to center a DIV vertically within the viewport with CSS? 
> (i.e. not with tables)?

> From what I can recall this isn't yet possible, but I'm sure someone here 
> will know.

'vertical-align: middle' is only valid for inline elements and (since
CSS2) table cell elements.

Schemes using CSS2 positioning might be possible (and even work in
some browsers), but would need javascript calculations of available
window height.

What's left is not using tables, but giving your DIVs display types
that makes them behave as tables. This in Opera and maybe also in
Mozilla.


Greetings,
 Rijk                            [EMAIL-REMOVED]
(Opera Software employee)

Mot du Jour:
Brain: The apparatus with which we think that we think.
Previous Message
Next Message

Message thread: