For mobile devices only, I am trying to display Related Products across 2 columns rather than 1.
So far I have tried the following code snippet which seems to create space for another column, but the products are only appearing on the left column. The right side is empty.
@media screen and (max-width: 767px){
.related.products ul.products li.product {
flex: 0 1 auto;
width: 40%;
}
}
Just to reiterate, the issue is on mobile. If you reduce the screen width, you can see that the CSS above squashes the recommended products to the left but doesn’t stack in 2 columns.
Any help is appreciated.
Note, I am also using Beaver Builder (similar to Elementor) if that helps but I don’t think that would have any impact on the CSS required.
2
Answers
I am not sure how your specific theme’s code or classes used are for that section, but I would just set it to 50% width.
The following code should work: