Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save gbechtold/2b5b542d8be286b1db4fa712b1ee60f0 to your computer and use it in GitHub Desktop.
Save gbechtold/2b5b542d8be286b1db4fa712b1ee60f0 to your computer and use it in GitHub Desktop.
/* This is an Example for a gallery-item in Elementor Custom CSS with Media Queries for different Elements */
/* Small devices (mobile/tablets, 767px and below) */
@media only screen and (max-width: 766px) {
selector .gallery-item img {
object-fit: cover;
height: 18.5em
}
}
/* Medium devices (tablets/desktops, 768px and up) */
@media only screen and (min-width: 768px) {
selector .gallery-item img {
object-fit: cover;
height: 6.35em;
}
}
/* Large devices (large laptops and desktops, 1168px and up) */
@media only screen and (min-width: 1168px) {
selector .gallery-item img {
object-fit: cover;
height: 11.35em;
}
}
@websprove
Copy link

Thanks for this one.

@alisanie
Copy link

🙏

@oooh-boi
Copy link

oooh-boi commented Jan 7, 2022

that's not correct, mobile first! No need for the query at all!

@shareeff99
Copy link

thanks you

@LittleMikeNZ
Copy link

Brilliant, thank you :)

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