kal2ennn Posted November 11, 2020 Posted November 11, 2020 Site URL: http://www.munchum.com/home-page I want to hide the 2nd landing image on desktop, and hide the 1st one when viewing on mobile.
Guest Posted November 11, 2020 Posted November 11, 2020 We can target device widths with CSS, so I'd suggest playing with the widths & resizing your window or checking on your phone to get the desired effect you want... That said, this CSS should hide the second section on devices/windows larger than 750px and hide the first (display second) on devices/windows smaller than 750px. @media only screen and (max-width: 750px) { .page-section:nth-of-type(1) { display: none; } } @media only screen and (min-width: 750px) { .page-section:nth-of-type(2) { display: none; } }
kal2ennn Posted November 11, 2020 Author Posted November 11, 2020 @mess_cal I tried that, but it didn't work.
Guest Posted November 12, 2020 Posted November 12, 2020 How did you test after you added the code @kal2ennn? I just tested the same code again over here on Chrome/Firefox and it seems to behave correctly.
tuanphan Posted November 12, 2020 Posted November 12, 2020 14 hours ago, kal2ennn said: @mess_cal I tried that, but it didn't work. If the code doesn't work, you can add this to Home > Settings > Advanced > Code Injection > Header <style> @media only screen and (max-width: 750px) { .page-section:nth-of-type(1) { display: none; } } @media only screen and (min-width: 750px) { .page-section:nth-of-type(2) { display: none; } } </style> Sometimes he copies missing characters, or pastes the wrong position, causing syntax error to occur & the code doesn't work (I have many cases when answering questions) 13 hours ago, mess_cal said: How did you test after you added the code @kal2ennn? I just tested the same code again over here on Chrome/Firefox and it seems to behave correctly. 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!)
kal2ennn Posted November 18, 2020 Author Posted November 18, 2020 @tuanphan@mess_cal Thanks, it's working now. I put it on www.munchum.com/home-sale , but now my footer disappears on. mobile. When I remove the code, the footer shows up, but obviously, 2 landing images show up in that case. Any idea? TIA
tuanphan Posted November 22, 2020 Posted November 22, 2020 On 11/19/2020 at 5:01 AM, kal2ennn said: @tuanphan@mess_cal Thanks, it's working now. I put it on www.munchum.com/home-sale , but now my footer disappears on. mobile. When I remove the code, the footer shows up, but obviously, 2 landing images show up in that case. Any idea? TIA The url doesn't exist. Can you check again? 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!)
Recommended Posts
Archived
This topic is now archived and is closed to further replies.