So you think the WordPress built in Gallery shortcode is actually pretty good, but you can't get rid of that irritating grey border around the images, here's how:
.gallery a img { border: 0 !important; }
The importance of the being !important; No need for fancy filters, or plugins. Just add the above code to your own stylesheet. The !important function means that this style overrides any later css, like inline styling (that is not itself also "!important").
Update: if your images are not links, you can remove the "a" selector.
Thank you!!
I’ve been trying to do this for weeks- thanks for your help!
Perfect answer. I really appreciate this, it was driving me nuts.
[…] to Derry Birkett for helping me find […]
You saved my life (the digital one) 🙂 thank you so much!
Hi Derry, couldn’t find what line of CSS in the parent theme was adding the unwanted image border !important finally came through thank goodness! Ta
This issue has been driving me demented! I am a beginner with all of this but the text u suggest putting in, to eradicate the gallery image borders (that make my images look like place mats) . Sounds daft , but where do I put it? Thanks! Lucie uk
In your style.css file (or in the theme options CSS if you have one with your theme)
You need to put it in your theme stylesheet. How you do that will depend on your setup.
THANK YOU! I’ve been looking for this for hours, finding all sorts of suggestions, but nothing worked until this one. Can’t even express how grateful I am.
I know that feeling.