steve_plaster Posted June 21, 2022 Share Posted June 21, 2022 Site URL: https://www.bristolharbourfestival.co.uk/ Hey I have a video playing on the desktop with an image being used as a mobile fallback. However the image for the fallback is being stretch and I can't fix. Anyone able to assist? Thanks Simon Link to comment
tuanphan Posted June 22, 2022 Share Posted June 22, 2022 It looks like you solved with this CSS? @media screen and (max-width: 600px) { #collection-5fd25ba5faf0e33e98cef9f1 section:first-child { min-height:65vh !important; height: 65vh !important; width: 10% !important; min-width: 100% !important } #collection-5fd25ba5faf0e33e98cef9f1 section:first-child img { width: 80% !important; height: auto !important; background-repeat: no-repeat !important; background-size: contain !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
steve_plaster Posted June 22, 2022 Author Share Posted June 22, 2022 Unfortunately, that didn't completely solve it. I could edit the vh area of the image with this: @media screen and (max-width:600px) { #collection-5fd25ba5faf0e33e98cef9f1 section:first-child { min-height: 65vh !important; height: 65vh !important; width: 10%!important; min-width: 100%!important; } However none of those styles had a direct impact on the fall back image itself. That image still looks crushed on mobile 😞 I don' think this is doing anything.. #collection-5fd25ba5faf0e33e98cef9f1 section:first-child img { width: auto!important; height: 100%!important; background-repeat: no-repeat!important; background-size: contain!important; } Link to comment
steve_plaster Posted June 23, 2022 Author Share Posted June 23, 2022 @tuanphanwe've found how to target the image! It's working. Thanks again for your help. .custom-fallback-image{ object-fit: contain !important; } tuanphan 1 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