Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save simbasounds/8b5b1363066d2150d6904be928b0aa5c to your computer and use it in GitHub Desktop.
Save simbasounds/8b5b1363066d2150d6904be928b0aa5c to your computer and use it in GitHub Desktop.
This code will remove the borders around WordPress gallery images and change the layout model to CSS flexbox.
.gallery {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
-webkit-box-pack: justify;
-ms-flex-pack: justify;
justify-content: space-between;
}
.gallery br {
display:none;
}
.gallery-item {
-ms-flex-preferred-size: 16%;
flex-basis: 16%;
margin: 0 !important;
}
@media only screen and (max-width: 760px) {
body .gallery-item {
-ms-flex-preferred-size: 32%;
flex-basis: 32%;
}
}
.gallery-item img {
border: none !important;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment