By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.

    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

CSS Masonry images side by side Wordpress

Hello :blush:!

Hopefully there is a css writing expert here who has a good solution for my masonry Wordpress theme script.

The intention is to get two columns of images on small screens (such as a mobile phone) instead of one column (as it is standard in the theme).
So far I have the code below, but with this code I get irregular empty gabs between images (see photo).

This is the script:
@media (max-width: 767px) {
.page-fluid-width.sidebar-position-right.menu-position-top .index-isotope.v3 .item-isotope {    padding: 15px 5px !important;    float: left !important;     width: 49% !important;
}    .index-isotope.v3 article.pluto-post-box.format-quote .post-body {    padding: 15px!important;}

The link to my website is www.free-crochet-patterns.com

Any idea how I can make the images fit together nicely without big gaps? I would be sooo happy if this can be solved. Thanks a lot for helping me out.

Welcome to CodeForum!

You could add the following properties to the parent element of the images:
display: flex;
flex-flow: row wrap;
This is so much better. I changed my script this way:
@media (max-width: 767px) {
.page-fluid-width.sidebar-position-right.menu-position-top .index-isotope.v3 .item-isotope {    padding: 15px 5px !important;    float: left !important;    width: 49% !important;
            height: 325px !important;
            display: flex;
flex-flow: row wrap;}    .index-isotope.v3 article.pluto-post-box.format-quote .post-body {    padding: 15px!important;}

Thanks a lot!

New Threads

Latest posts

Buy us a coffee!

Top Bottom