Skip to content

Instantly share code, notes, and snippets.

@Qubadi
Last active January 17, 2024 15:30
Show Gist options
  • Save Qubadi/fa9333bb1a078d3092212cf3708d20f9 to your computer and use it in GitHub Desktop.
Save Qubadi/fa9333bb1a078d3092212cf3708d20f9 to your computer and use it in GitHub Desktop.
Enhancing Elementor Basic Gallery: Custom Code for Responsive Column Control
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