Skip to content Skip to sidebar Skip to footer

How To Align An Image To The Bottom Of The Div?

I'm trying to align an image to the bottom of the out div element using vertical-align,but this vertical-align doesn't seem to work,the image is not moving at all.

Solution 2:

You can use flexbox for this. Appling the parent styles to the DIV. No extra styling needed for img

.parent {
  display: flex;
  justify-content: flex-end;
  flex-direction: column;
}

Here's what you'll want to add if you don't have a taskrunner adding the prefixes for maximum compatibility.

.parent {    
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-justify-content: flex-end;
            -ms-flex-pack: end;
          justify-content: flex-end;
  -webkit-flex-direction: column;
      -ms-flex-direction: column;
          flex-direction: column; 
}

Currently 97% of the browsers used today support flex.

Post a Comment for "How To Align An Image To The Bottom Of The Div?"