Vulkan101 Posted October 31, 2023 Posted October 31, 2023 (edited) Hello! I know this topic has been addressed many times but I can't find the explanations to my issue. I have Squarespace 7.0. I added custom css for 2-column product grid. On my laptop its fine, on the mobile, the New release section is not aligning. What am I doing wrong? Text is too long? Code used : /* Homepage products 2 columns mobile */ @media screen and (max-width:640px) { div#page-650a834d556c5610652818d8 .span-3 { width: 48% !important; float: left !important; padding: 0px !important; }} Thanks. Edited October 31, 2023 by Vulkan101 missing explanations
SaranyaDesigns Posted October 31, 2023 Posted October 31, 2023 You should use flexbox instead of float, can you please provide link to your website? Then we can provide more specific code 🙂 thanks! JayVanDyke 1
Vulkan101 Posted October 31, 2023 Author Posted October 31, 2023 Hi @SaranyaDesigns. Thanks for the reply. See here : https://juliearbourdesign.com SaranyaDesigns 1
SaranyaDesigns Posted November 1, 2023 Posted November 1, 2023 @Vulkan101 thanks, try this custom CSS instead, you can target any of the parent rows of the column groups with this, but these are the two groups of columns I can see on your homepage: @media (max-width:640px) { #yui_3_17_2_1_1698855416983_98, #yui_3_17_2_1_1698855684213_221 { display: flex; flex-wrap: wrap; } } And then if you specifically want to lock it into two columns, remove your width 50% and float left properties and add this instead: @media (max-width:640px) { #yui_3_17_2_1_1698855416983_98 col, #yui_3_17_2_1_1698855684213_221 col { flex-basis: 50%; } } So the whole thing looks like this: @media (max-width:640px) { #yui_3_17_2_1_1698855416983_98, #yui_3_17_2_1_1698855684213_221 { display: flex; flex-wrap: wrap; } #yui_3_17_2_1_1698855416983_98 col, #yui_3_17_2_1_1698855684213_221 col { flex-basis: 50%; } } Let me know?
Vulkan101 Posted November 3, 2023 Author Posted November 3, 2023 Thanks although when I copy your code it doesnt work. Shows up as 1 column.
SaranyaDesigns Posted November 3, 2023 Posted November 3, 2023 (edited) @Vulkan101 Oh whoops, my bad. Typo in the selector... this should work: @media (max-width:640px) { #yui_3_17_2_1_1698855416983_98, #yui_3_17_2_1_1698855684213_221 { display: flex; flex-wrap: wrap; } #yui_3_17_2_1_1698855416983_98 .col, #yui_3_17_2_1_1698855684213_221 .col { flex-basis: 50%; } } Remember to remove your existing float and width properties first. Edited November 3, 2023 by SaranyaDesigns
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment