Skip to content

Instantly share code, notes, and snippets.

@dospuntocero
Created February 24, 2019 16:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dospuntocero/77d08cd7d108bdbd497091c399bff10f to your computer and use it in GitHub Desktop.
Save dospuntocero/77d08cd7d108bdbd497091c399bff10f to your computer and use it in GitHub Desktop.
used this technique to expand an image to fill the whole div and maintain aspect ratio
.full-image-div{
width:100%;
height:100%;
object-fit: cover;
overflow: hidden;
}
@dospuntocero
Copy link
Author

actually, with just height 100% and object-fit will work, but in this case the other stuff was needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment