Jump to content

How to remove unwanted grey section space after I resize an image for mobile view?

Recommended Posts

Posted

Hi, 

im hoping someone can help?

I can’t get rid of the grey space after resizing my main background image for mobile view. My site isn’t live yet and still trying to understand how this works.

I found a feed on here and have been trying this code but it doesn’t appear to work for me?

/* Mobile-Homepage-topbanner */
@media screen and (max-width:767px) {
section[data-section-id="5edddb08ea5e395a85788610"] {
    min-height: unset !important;
    height: 35vh !important;
    margin-top: 15vh;
}
}

attached image of my site in mobile view is the best I can do currently atm. 
this uses the resize code, also found on this forum, below.

@media screen and (max-width:640px) {
.homepage .section-background img {
    width: 100% !important;
    height: auto !important;
}
}

so I think it must be a combination of both somehow?

Any help would be greatly appreciated!!

 

889F2E7C-B775-4F44-88E4-9CEE29870A9C.jpeg

  • Replies 5
  • Views 451
  • Created
  • Last Reply
Posted

The image also doesn’t resize correctly in I pad view (when the iPad is vertical).  Is there some code that will automatically resize the image and section for device used? 
many thanks!

Posted

Hi. Don't remove any code in your current code.

Add this to Design > Custom CSS

/* remove grey space on mobile */
@media screen and (max-width:767px) {
[data-section-id="6182a66412336b4fc5cf549e"] {
    min-height: unset !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!)

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.