Page 1 of 1

valign?

Posted: Tue Nov 15, 2005 10:45 pm
by s.dot
whats the equivalent of this in css?

Code: Select all

<td align="center" valign="bottom">
So far I have this:

Code: Select all

<div style="height: 100px; width: 300px; padding: 2px; text-align: center;">
All's good but the text is at the top of the div.

Posted: Tue Nov 15, 2005 10:54 pm
by Roja

Code: Select all

td {
   align : center;
  valign : bottom;
  }

Posted: Tue Nov 15, 2005 10:58 pm
by RobertGonzalez
If it is in a DIV you may want to add display: block to it and set your vertical-align property to middle. You can also specify a height of some amount or you could just add equal padding to the top and bottom of the div to align it in the middle.

Code: Select all

element {
    padding-top: 10px;
    padding-bottom: 10px;
}

Posted: Tue Nov 15, 2005 11:03 pm
by s.dot
yeah, it is in a div :P i was just giving the example of a td of how I wanted the data to behave, it's not an actual td, would display: table-cell; valign: bottom be good? (don't know why i asked ;/ im about to try :P)

Posted: Wed Nov 16, 2005 7:48 am
by yum-jelly

Code: Select all

<div style="height : 100px; width : 300px; padding : 2px; text-align : center; vertical-align : bottom">
Where valid values are...

baseline
sub
super
top
text-top
middle
bottom
text-bottom


yum-jelly