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
Open

CSS hack for quickly resizing images for mobile devices #84

GraemeFulton opened this issue Jun 8, 2019 · 1 comment
Assignees
Labels
coolhack This trick is cool dailyhack This issue belongs to dailyhack.xyz trick

Comments

@GraemeFulton
Copy link

GraemeFulton 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
Copy link
Owner

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

@mddanishyusuf mddanishyusuf added coolhack This trick is cool dailyhack This issue belongs to dailyhack.xyz trick labels Jun 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
coolhack This trick is cool dailyhack This issue belongs to dailyhack.xyz trick
Projects
None yet
Development

No branches or pull requests

2 participants