Jump to content

Code to resize an image / banner image for mobile so width is kept at 100% and no cropping

Recommended Posts

  • Replies 1
  • Views 483
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

On 11/1/2021 at 8:23 PM, LyndaKendall said:

Site URL: https://creativebd.squarespace.com/

HI there

I have been trying various CSS that I have found on the forum to resize any page banner so that it doesn't crop for mobile (ie just stays at 100% width) - and doesn't lose the top half of the image under the navigation.

I would really appreciate help on this one.

Thanks

Add to Design > Custom CSS

/* Mobile-resize home top image */
@media screen and (max-width:767px) {
[data-section-id="616eb6ce772bf431e5de5426"] {
    min-height: unset !important;
    height: 35vh;
    margin-top: 15vh;
}
}

 

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.