valign?

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

valign?

Post 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.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Post by Roja »

Code: Select all

td {
   align : center;
  valign : bottom;
  }
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post 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;
}
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post 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)
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
yum-jelly
Forum Commoner
Posts: 98
Joined: Sat Oct 29, 2005 9:16 pm

Post 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
Post Reply