Guest Posted March 5, 2020 Share Posted March 5, 2020 Site URL: https://www.jupiter10.com Hi, I’m trying to make the ‘related products’ displayed in 2 columns for mobile users. I’m currently using the code below to display the product page in 2 columns and it works perfectly, how can I tweak it in order to also make it apply to related products? Many thanks in advance. @media only screen and (max-width: 700px) { #productList .product { clear: none!important; margin-bottom: 2em; width: 48%; } #productList .product:nth-of-type(odd) { margin-right: 3%; clear: left; } .product img { max-width: 100%; max-height: 100%; } } Link to comment
Solution tuanphan Posted March 6, 2020 Solution Share Posted March 6, 2020 @media only screen and (max-width: 640px) { .ProductItem-relatedProducts-item { float: left; margin-bottom: 2em; width: 48%; } .ProductItem-relatedProducts-item:nth-of-type(odd) { margin-right: 3%; clear: left; } } Giardiello 1 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
Guest Posted March 6, 2020 Share Posted March 6, 2020 Hey @tuanphan Thanks a lot !! the code works perfectly! 🙂 Link to comment
raego Posted March 8, 2020 Share Posted March 8, 2020 On 3/7/2020 at 3:24 AM, tuanphan said: @media only screen and (max-width: 640px) { .ProductItem-relatedProducts-item { float: left; margin-bottom: 2em; width: 48%; } .ProductItem-relatedProducts-item:nth-of-type(odd) { margin-right: 3%; clear: left; } } Any idea how to add padding down the middle? Link to comment
tuanphan Posted March 8, 2020 Share Posted March 8, 2020 31 minutes ago, raego said: Any idea how to add padding down the middle? Difficult to help without url. 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
raego Posted March 8, 2020 Share Posted March 8, 2020 12 hours ago, tuanphan said: Difficult to help without url. https://raegocreative.com/shop Link to comment
tuanphan Posted March 10, 2020 Share Posted March 10, 2020 On 3/9/2020 at 5:25 AM, raego said: https://raegocreative.com/shop Add to Home > Design > Custom CSS @media screen and (max-width:767px) { .list-grid { grid-column-gap: 10px; } } 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
raego Posted March 11, 2020 Share Posted March 11, 2020 11 hours ago, tuanphan said: Add to Home > Design > Custom CSS @media screen and (max-width:767px) { .list-grid { grid-column-gap: 10px; } } That worked perfectly thank you so much! Link to comment
raego Posted November 15, 2021 Share Posted November 15, 2021 This code now seems to be showing up weird on product pages. They are still in 2 columns but one column is bigger than the other, any idea how to fix? raegocreative.com.au/shop Link to comment
tuanphan Posted November 18, 2021 Share Posted November 18, 2021 On 11/15/2021 at 8:38 AM, raego said: This code now seems to be showing up weird on product pages. They are still in 2 columns but one column is bigger than the other, any idea how to fix? raegocreative.com.au/shop in this code @media screen and (max-width: 767px) { .list-grid { grid-template-columns: repeat(2,auto) !important; display: grid; float: left !important; } } change auto to 1fr 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
raego Posted November 25, 2021 Share Posted November 25, 2021 On 11/18/2021 at 12:28 PM, tuanphan said: in this code @media screen and (max-width: 767px) { .list-grid { grid-template-columns: repeat(2,auto) !important; display: grid; float: left !important; } } change auto to 1fr Thanks - but this makes products go back to 1 column not 2. Link to comment
tuanphan Posted November 27, 2021 Share Posted November 27, 2021 On 11/26/2021 at 4:15 AM, raego said: Thanks - but this makes products go back to 1 column not 2. I think you edit wrong thing, 1fr still make it to 2 columns. Add this code @media screen and (max-width: 767px) { .list-grid { grid-template-columns: repeat(2,1fr) !important; display: grid; float: left !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
raego Posted November 29, 2021 Share Posted November 29, 2021 On 11/27/2021 at 7:58 PM, tuanphan said: I think you edit wrong thing, 1fr still make it to 2 columns. Add this code @media screen and (max-width: 767px) { .list-grid { grid-template-columns: repeat(2,1fr) !important; display: grid; float: left !important; } } Thanks, see below - now this code doesn't do anything at all. Link to comment
tuanphan Posted November 30, 2021 Share Posted November 30, 2021 On 11/29/2021 at 7:15 AM, raego said: Thanks, see below - now this code doesn't do anything at all. Can you send all current code in Custom CSS? 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
artgirl81 Posted August 7, 2023 Share Posted August 7, 2023 On 11/28/2021 at 7:15 PM, raego said: On 11/27/2021 at 3:58 AM, tuanphan said: @media screen and (max-width: 767px) { .list-grid { grid-template-columns: repeat(2,1fr) !important; display: grid; float: left !important; } } I got this to work, in general, for a video page. I added in the float and the clear with the (odd) rule set, but the right column doesn't seem to pop-up next to the left column. Can you help? Page is: https://www.autoharpmusic.co/videos-demos-and-tips/v/getting-started-tuning-your-autoharp-303m Thank you! Link to comment
tuanphan Posted August 8, 2023 Share Posted August 8, 2023 On 8/7/2023 at 10:36 AM, artgirl81 said: Use this code @media screen and (max-width:767px) { .lessons-item-related-item-list { display: grid !important; grid-template-columns: repeat(2,minmax(0,1fr)) !important; grid-gap: 10px !important; width: 100% !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