scholarsayze Posted June 10, 2020 Share Posted June 10, 2020 Site URL: https://bluebird-porcupine-yzdg.squarespace.com/ Hello, I understand that you can have a web element appear only on desktop and to be hidden on mobile using this code: @media only screen and (max-width:768px) { div#block-BLOCK ID HERE>.sqs-block-content:first-child { display: none; } } But I want to know if it is possible to show a web element (e.g. an image or text etc) just on mobile and not visible on desktop view? Please advise, Many thanks! Best, Faiz Link to comment
tuanphan Posted June 10, 2020 Share Posted June 10, 2020 @media only screen and (min-width:769px) { div#block-BLOCK ID HERE>.sqs-block-content:first-child { display: none; } } justin_phang 1 Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care Link to comment
scholarsayze Posted June 10, 2020 Author Share Posted June 10, 2020 That's awesome thanks so much! Works perfectly. So is the code is basically saying that, any device with a greater width than 769px the block element will not show? I hope I have understood the code correctly?! Link to comment
tuanphan Posted June 10, 2020 Share Posted June 10, 2020 yes. In fact, if you use SS 7.1, it should be 768px, and SS 7.0 is 641px Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care Link to comment
scholarsayze Posted June 10, 2020 Author Share Posted June 10, 2020 OK yes that's great! I'm trying to learn the code rather than just copying + pasting so thank you! Should I change this code then to: @media only screen and (min-width:768px) { div#block-BLOCK ID HERE>.sqs-block-content:first-child { display: none; } } what about the code to hide on mobile device, should this stay the same as here? @media only screen and (max-width:768px) {div#block-BLOCK ID HERE>.sqs-block-content:first-child { display: none;}} Link to comment
tuanphan Posted June 10, 2020 Share Posted June 10, 2020 with mobile, max-width:767px Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care Link to comment
scholarsayze Posted June 10, 2020 Author Share Posted June 10, 2020 OK great, I will change the code to hide on mobile device as here: @media only screen and (max-width:767px) {div#block-BLOCK ID HERE>.sqs-block-content:first-child { display: none;}} Thank you so much for your time, I do appreciate your help. Link to comment
scholarsayze Posted June 10, 2020 Author Share Posted June 10, 2020 Sorry, just to add on here, as well as removing an element in mobile view, is it possible to remove an entire section so it doesn't appear on mobile view? Link to comment
tuanphan Posted June 10, 2020 Share Posted June 10, 2020 5 hours ago, scholarsayze said: Sorry, just to add on here, as well as removing an element in mobile view, is it possible to remove an entire section so it doesn't appear on mobile view? Which template do you use? or which SS version: 7.0 or 7.1? Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care Link to comment
scholarsayze Posted June 11, 2020 Author Share Posted June 11, 2020 Thanks Tuanphan I it's v7.1 Link to comment
RyanDejaegher Posted June 11, 2020 Share Posted June 11, 2020 On 6/10/2020 at 11:22 AM, scholarsayze said: Sorry, just to add on here, as well as removing an element in mobile view, is it possible to remove an entire section so it doesn't appear on mobile view? @scholarsayze yes it's possible to remove entire sections using CSS and media queries. Philadelphia, PA 👉 Squarespace Tutorials Chat/Message on FB Messenger for quickest response: https://m.me/dejaegherryan Link to comment
Solution tuanphan Posted June 12, 2020 Solution Share Posted June 12, 2020 18 hours ago, scholarsayze said: Thanks Tuanphan I it's v7.1 @media screen and (max-width:767px) { [data-section-id="abcxyztuan"] { display: none; } } Find ID with this tool https://chrome.google.com/webstore/detail/squarespace-id-finder/igjamfnifnkmecjidfbdipieoaeghcff scholarsayze 1 Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care Link to comment
scholarsayze Posted June 12, 2020 Author Share Posted June 12, 2020 Thanks so much works perfectly!!! Link to comment
meganntab Posted June 14, 2021 Share Posted June 14, 2021 I followed the steps on this and, it worked, but I have a bunch of extra padding beneath the section I removed on the mobile version. Desktop version looks fine. Is there a way to fix this? Link: https://www.nationaltab.com/solutions Link to comment
tuanphan Posted June 15, 2021 Share Posted June 15, 2021 18 hours ago, meganntab said: I followed the steps on this and, it worked, but I have a bunch of extra padding beneath the section I removed on the mobile version. Desktop version looks fine. Is there a way to fix this? Link: https://www.nationaltab.com/solutions Hi. Target data-section-id, don't target block id. Use this tool to find data section id. https://chrome.google.com/webstore/detail/squarespace-id-finder/igjamfnifnkmecjidfbdipieoaeghcff?hl=en Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care 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