Wrap image with relative padded parent. Keep image ratio with percentage on the padding property. Image is full size absolute child.

.wrapper {
  position: relative;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
}
img {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: auto;
}

Leave a Reply

Your email address will not be published. Required fields are marked *