Find out in this tutorial how to get gallery block images to display in a single column on mobile using CSS.
If you are using the WordPress gallery block you will have noticed that it allows you to choose the number of columns you want to distribute the images in.
The catch is that these settings are general and when you choose 2 or more columns it may look great on large screen devices but on mobile devices you may prefer to display it with only one column. This way the images will look much better on small screens.
Let’s see how you can achieve this:
Snippet to display WordPress gallery images in one column on mobile devices
Add the following code in the style.css file:
You got it.
Now you know how to get WordPress gallery images to display in a column when viewed from a mobile device with a little CSS.
Any questions? Let me know in the comments.
And if you want to give me any suggestion for future tutorials, leave it in the contact form. Advantages of being a subscriber. 😉