Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSS hack for quickly resizing images for mobile devices #84

Open
GraemeFulton opened this issue Jun 8, 2019 · 1 comment

Comments

@GraemeFulton
Copy link

commented Jun 8, 2019

Use object-fit cover on your images for a quick way to resize images without ruining proportions...

@media (max-width: 540px) {
    img{
      max-height:200px;
      max-width:100%;
      object-fit:cover; 
    }
}

Here's a demo: https://twitter.com/graeme_fulton/status/1137409649857220608

@mddanishyusuf

This comment has been minimized.

Copy link
Owner

commented Jun 8, 2019

Thanks, @GraemeFulton for adding this cool tricks. I love this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.