PDA

View Full Version : CSS-P & vertical alignment


Coober
06-28-2005, 06:15 PM
Is it possible to use vertical-align: middle or similar with layers/css?

It seems that this only applies to <td> tags.

Thanks,

Coober

domedia
06-28-2005, 06:20 PM
vertical-align is not made to vertically align something inside a block element (for example a layer/div).
More on vertical-align in CSS: http://www.domedia.org/oveklykken/css-vertical-align.php ('http://www.domedia.org/oveklykken/css-vertical-align.php')

Coober
06-28-2005, 08:02 PM
If I understand correctly, I have to insert a table into my layer, then I can centre it vertically.

Coober

domedia
06-28-2005, 08:10 PM
Actually you don't use vertical-align all (see the link above). It's not meant to align stuff vertically.
Use a top margin or something else.
If you want hands on help you need to show some code.

cperkins
06-28-2005, 11:09 PM
Yes, the question is: what is it you are trying to do? Align something vertically on a page, suspend something in the middle of a block container?

There are a number of different approaches in CSS.

This link reviews a bunch of different vertically centering techinques, many of them can be used inside other containers, not simply page-wide:
http://www.student.oulu.fi/~laurirai/www/css/middle ('http://www.student.oulu.fi/~laurirai/www/css/middle')

My favorite is the 'center line' method:
http://www.wpdfd.com/editorial/thebox/deadcentre3.html ('http://www.wpdfd.com/editorial/thebox/deadcentre3.html')


Hope this helps,

Chris Perkins
Media Lab, Inc.
---- Web and flash plug-ins for Photoshop and DreamWeaver ----
http://www.medialab.com ('http://www.medialab.com')