Last active
January 17, 2024 15:30
-
-
Save Qubadi/fa9333bb1a078d3092212cf3708d20f9 to your computer and use it in GitHub Desktop.
Enhancing Elementor Basic Gallery: Custom Code for Responsive Column Control
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
See the tutorials here: https://www.youtube.com/watch?v=E3e0kLLb7sU | |
_____________________________________________ | |
/* Base style for the gallery */ | |
.gallery { | |
display: grid; | |
grid-template-columns: repeat(3, 1fr); | |
} | |
/* Ensure images take full width of the column */ | |
.gallery img { | |
width: 100% !important; | |
height: auto !important; | |
display: block !important; | |
} | |
/* Style for screens up to 1024px (for tablets) */ | |
@media (max-width: 1024px) { | |
.gallery { | |
grid-template-columns: repeat(3, 1fr); | |
} | |
} | |
/* Style for screens up to 767px (for phones) */ | |
@media (max-width: 767px) { | |
.gallery { | |
grid-template-columns: repeat(2, 1fr); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment