I wanted to change how my site displays my products on a mobile device.
As standard it was displaying one item per row and i wanted to show two items per row.
I used the following CSS to acheive this:
@media only screen and (max-width: 600px) {
.product-item{
width: 50%;
}
}
I tested in chrome and firefox browser tools and it appeared to work fine on mobile view.
On a real phone there is white gaps and sometimes only 1 item per line.
Can anyone help? My website url is: DELETED URL
Update: Screenshot of what happens DELETED URL
3
Answers
I found a temporary fix. I used:
I could see the first item was messing up the layout. I removed it from the category and re added it at the bottom. This is by no means a fix but it is a good solution to fix the display while i fix the parse errors.
This wouldn't have been possible without the help from @Thorsten Wolske and @Nikhil Gangurde
Your code is missing this:
for each device.
this list from css-tricks.com could be helpful:
https://css-tricks.com/snippets/css/media-queries-for-standard-devices/
if you want to align everything in a correct row the classes eventually need a float declaration:
If you get spacings that should not be there, there is very simple solution:
Your css also suffers some parse errors which could also lead to some
errors.
Here is a unicorn test of your shop:
https://validator.w3.org/unicorn/check?ucn_uri=https%3A%2F%2Fblupstore.com%2F&ucn_task=conformance#
You can add some css style.