nina Posted November 12, 2020 Share Posted November 12, 2020 Site URL: https://www.visuelle.dk/ Hi! I'm trying to work around an issue on this website: https://www.visuelle.dk/ The problem is that the video on the front page is not suitable for mobile view. Is there a code where I can replace the video with an image in the mobile version? Or an even better way to work around it, that I don't know about? Link to comment
Alpi87 Posted November 12, 2020 Share Posted November 12, 2020 Hi! I think the best way to do it is basically to create two sections / blocks. The first will be a block video that will be hidden in phone view with a @media only screen and (min-width: ---px). The second will be a block image with a @media only screen and (max-width: ---px) that will be hidden in desktop views. All you have to do is to target the elements on the browser and include it on the media queries. I hope this helps you. Link to comment
nina Posted November 13, 2020 Author Share Posted November 13, 2020 Hi Alpi87, Thanks for taking time to reply 🙂 I've just tried making a new block underneath the video with an image to replace the video and with this code: @media screen and (min-width: 640px) { #block-yui_3_17_2_1_1604939840025_6352 { display: none; } } @media screen and (max-width: 640px) { #block-yui_3_17_2_1_1605258275843_406161 { display: none; } } It doesn't work unfortunately. The video disappear but instead of showing the mobile image, there is an empty block. I guess it is because its a fullscreen background video and not a video-block? Hope it makes sense.. Link to comment
tuanphan Posted November 20, 2020 Share Posted November 20, 2020 Hi. Do you still need help on this? If yes, we can give the code to hide 1 block on mobile, hide 1 block on desktop 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
Jaime Santa Cruz Posted November 8, 2021 Share Posted November 8, 2021 Hi Tuanphan, I need help. Can you send me the code to hide 1 block on mobile, hide 1 block on desktop. Please. It would be really useful. Thank in advance, Link to comment
tuanphan Posted November 10, 2021 Share Posted November 10, 2021 On 11/9/2021 at 1:54 AM, Jaime Santa Cruz said: Hi Tuanphan, I need help. Can you send me the code to hide 1 block on mobile, hide 1 block on desktop. Please. It would be really useful. Thank in advance, use this CSS /* hide block 1 on desktop */ @media screen and (min-width:768px) { #block-1-id {display:none;} } /* hide block 2 on mobile */ @media screen and (max-width:767px) { #block-2-id {display:none;} } Use this code to find block 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 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