Industria1234 Posted July 26, 2023 Share Posted July 26, 2023 (edited) Hello, We would like to have the header image (homepage) on our mobile website that are different from the desktop version. Is that possible and does someone know how to do this? Thank you in advance! Site: https://harp-apricots-3p6k.squarespace.com Password: culetti Edited July 26, 2023 by IndustriaCreativa mistakes Link to comment
Solution tuanphan Posted July 27, 2023 Solution Share Posted July 27, 2023 Yes. Possible. You can use 2 images, then we can give code to show 1 on desktop, show another on mobile. But you can consider resize image on mobile only, by using this code (Design > Custom CSS) /* resize list image on mobile */ @media screen and (max-width:991px) { [data-section-id="64bfc8ff390e20685cb86214"] ul { min-height: unset !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
KRITIKOZZZ Posted July 27, 2023 Share Posted July 27, 2023 16 hours ago, tuanphan said: Yes. Possible. You can use 2 images, then we can give code to show 1 on desktop, show another on mobile. But you can consider resize image on mobile only, by using this code (Design > Custom CSS) /* resize list image on mobile */ @media screen and (max-width:991px) { [data-section-id="64bfc8ff390e20685cb86214"] ul { min-height: unset !important; } } Is there a code to do this same thing for a background image? I like my homepage banner background image, but on mobile it gets cropped because of the vertical format. Link to comment
tuanphan Posted July 28, 2023 Share Posted July 28, 2023 14 hours ago, KRITIKOZZZ said: Is there a code to do this same thing for a background image? I like my homepage banner background image, but on mobile it gets cropped because of the vertical format. Yes. Possible. Use this code /* resize list image on mobile */ @media screen and (max-width:991px) { [data-section-id="64bfc8ff390e20685cb86214"] .section-border img { content: url(https://cdn.pixabay.com/photo/2023/06/04/11/42/river-8039447_1280.jpg); } } Replace with your data section id. Use this free tool to find id https://chrome.google.com/webstore/detail/squarespace-id-finder/igjamfnifnkmecjidfbdipieoaeghcff Or you can share site url, we can also give code to resize image on mobile, so no need to use new image 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
KRITIKOZZZ Posted July 28, 2023 Share Posted July 28, 2023 8 hours ago, tuanphan said: Yes. Possible. Use this code /* resize list image on mobile */ @media screen and (max-width:991px) { [data-section-id="64bfc8ff390e20685cb86214"] .section-border img { content: url(https://cdn.pixabay.com/photo/2023/06/04/11/42/river-8039447_1280.jpg); } } Replace with your data section id. Use this free tool to find id https://chrome.google.com/webstore/detail/squarespace-id-finder/igjamfnifnkmecjidfbdipieoaeghcff Or you can share site url, we can also give code to resize image on mobile, so no need to use new image I tried that code and it changed my desktop background as well. I'm not sure if i'm doing this correctly. What i am looking for is my header background image on desktop to remain as is, and to swap that image out on mobile completely to another one so it isn't cropped weird. site is www.aurabyangelo.com section id is 63c5d881a578a930412be534 Link to comment
tuanphan Posted July 29, 2023 Share Posted July 29, 2023 8 hours ago, KRITIKOZZZ said: I tried that code and it changed my desktop background as well. I'm not sure if i'm doing this correctly. What i am looking for is my header background image on desktop to remain as is, and to swap that image out on mobile completely to another one so it isn't cropped weird. site is www.aurabyangelo.com section id is 63c5d881a578a930412be534 That code runs on mobile + tablet only. If it change both desktop + mobile, maybe you placed code in wrong position. Can you send all code in CSS after you added above code? 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