Masiar
Masiar

Reputation: 21352

aligning the text in a div to the bottom

I have two divs next to each other, one with float: right and the other with float: left. The one on the left contains an image (200x100px) and the div on the right should contain a text. I would like to have the text of the div on the right to start on the bottom left of the div instead of the top left, is that possible somehow? Thanks

Upvotes: 0

Views: 151

Answers (3)

Bill Criswell
Bill Criswell

Reputation: 32941

You can make the container position: relative then make a div inside with position: absolute; bottom: 0; left: 0;

<div style="position: relative; height: 300px; width: 300px; background-color: #f00;">
  <div style="position: absolute; bottom: 0; left: 0; right: 0; background-color: #00f;">
    This will be at the bottom!
  </div>
</div>

Upvotes: 2

mkk
mkk

Reputation: 7693

you can try to add to your div this css:

 #rightDiv{
   display: table;
   vertical-align: bottom;
}

Upvotes: 0

Andreas Eriksson
Andreas Eriksson

Reputation: 9027

Try this css rule on the span, paragraph or whatever you're placing the text in:

vertical-align: bottom;

Upvotes: 0

Related Questions