DangDang Posted January 10 Share Posted January 10 (edited) I'm building a site with a portfolio section. On desktop, I have four images per row, but on mobile view it automatically switches to a "feed" with one image at a time/stacked on top of each other. I'm trying to adjust the CSS so that I can have at least three images per row even on mobile. Through the forum I found the following code, which works for 2 images per row. I'm now trying to adjust it to show three images per row instead. However, If I simply change the number "repeat(3,1fr);" it works, but the images differs in size (see screenshot) /* portfolio mobile */ @media screen and (max-width:767px) { div#gridThumbs { grid-template-columns: repeat(2,1fr); }} Any ideas? URL: https://caterpillar-parrotfish-m9mk.squarespace.com/all-work Password for site is AFLA Edited January 10 by DangDang wording of a sentence Link to comment
tuanphan Posted January 11 Share Posted January 11 You can use this CSS code @media screen and (max-width:767px) { div#gridThumbs { grid-template-columns: repeat(3,1fr) !important; grid-gap: 10px 10px !important; } } Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment