• Skip to primary navigation
  • Skip to main content
OsomCode

OsomCode

Awesome code tutorials for WordPress and Genesis

  • Subscribe
  • My account
    • Edit profile
    • Favorites
    • Update credit card
  • Login

Display gallery block images in one column in cell phones

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:

To see this and another 847 code snippets of this website, login or subscribe here.

You got it.

Conclusions

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. 😉

CSS

To leave read and make questions about this code, you can login or register.

  • About OsomCode
  • FAQ
  • Contact

Legal Notice · Privacy Policy · Cookie Policy · Terms and conditions
Copyright © 2023

Lost your password?