-2

I have a div (with fixed height) with this CSS:

.div {
color: white;
font-family: Bahnschrift;
text-align: justify;
vertical-align: text-top;
} 

As you can see, in this div there are paragraphs vertical aligned at the top. I want to align only the last paragraph (class="lastpar") at the bottom of the div, this is the CSS:

.lastpar {
position: relative;
vertical-align: text-bottom;
}

But it doesn't work, could you please help me to align it at the bottom of the div? Thanks

Marco P
  • 115
  • 1
  • 7

1 Answers1

1

Vertical-align is not intended for aligning block elements.

Use flexbox for this

apply the following rule to the parent

div {
     display: flex;
     justify-content: flex-end;
}

then in another div wrap all elements but the paragraph you want to remain at bottom, and you're all set.

Sandeep C. Nath
  • 927
  • 1
  • 10
  • 22