i want to make 2 column on tablet and single on mobile:
link to my website: https://djdropsonline.com/collections/au
pass: showff
A user seeks to implement a responsive layout displaying 2 columns on tablets and a single column on mobile devices for their Shopify store.
Proposed Solutions:
Multiple respondents offered CSS-based approaches:
base.css adjusting .products .product-card width to create 2-column layoutscalc(100% - 40px) for single-column displaybase.css file in the Assets folder, though one recommends theme.liquid above the </body> tagTechnical Note:
Several code snippets and images appear corrupted or reversed in the original thread, making exact implementation details unclear. The core approach involves using CSS media queries with calculated widths and margins to control product card layouts at different screen sizes.
Status: Multiple solutions provided but no confirmation from the original poster on which approach worked or if the issue was resolved.
i want to make 2 column on tablet and single on mobile:
link to my website: https://djdropsonline.com/collections/au
pass: showff
Hey @s1media
Follow these Steps:
If I managed to help you then, don’t forget to Like it and Mark it as Solution!
Best Regards,
Moeed
From your Admin panel, click Online Store > Themes >Actions > Edit code
find and open the base.css file
Paste the code below at the very bottom of the file.
@media only screen
and (min-device-width: 768px)
and (max-device-width: 1024px)
and (-webkit-min-device-pixel-ratio: 2) {
.products .product-card {
width: calc(50% - 40px) !important;
}
}
@media only screen
and (min-device-width: 320px)
and (max-device-width: 750px)
and (-webkit-min-device-pixel-ratio: 2) {
.products .product-card {
width: calc(98% - 20px) !important;
}
}
Hi @s1media
You can make the images responsive according to tablet and mobile by following the instructions below
@media only screen and (max-width: 950px){
.products .product-card {
margin: 0 20px 20px;
width: calc(50% - 40px);
}
}
@media only screen and (max-width: 481px){
.products .product-card {
margin: 0 20px 20px;
width: calc(100% - 40px);
}
}
@s1media ,
In your Shopify Admin go to online store > themes > actions > edit code
In your theme.liquid file, find the **(press CTRL + F or command + F on Mac)
paste this code right above the tag:
If it helps you please click on the “like” button and mark this answer as a solution!
Thank you.
Kind regards,
Diego