I have some text in a block level element. I want the baseline of the text aligned to the bottom of its container. Is that possible? Here is what I have so far, but it aligns the bottom of the text (including descenders), not the baseline.

.block-container {
    position: relative;
    height: 120px;
.text {
    position: absolute;
    bottom: 0;

Here is a graphic that demonstrates what I am looking for.

alt text


1 answer


I can't think of a more type-safe way than setting bottom to a negative px value (example: -5px) that works for the specific type size and font.

Answered over 8 years ago by Jude Hansen
  • I was hoping to avoid that because it could cause reliability problems if the user's font does not match, but it seems to be the only option. Michael Crumley over 8 years ago