I am trying to vertically align my div (which is inside of a td) to be at the top, but vertical-align: top is not working. Here is the fiddle:
http://jsfiddle.net/hreDw/1/ (I want that yellow b to be at the top)
How can I do this? Also, amount of a's inside of the second td is dynamic - so the height of the table is also dynamic.
The
vertical-alignCSS property specifies the vertical alignment of an inline or table-cell box.
Read more about vertical-align
Therefore, you have to apply the vertical-align property to the td element:
.first {
background-color:black;
min-height: 10px;
min-width: 10px;
vertical-align: top;
}
.first div {
background-color:yellow;
}
.second {
background-color:green;
min-height: 10px;
width: 10px;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With