Jump to content

Resize Index Images for Mobile

Recommended Posts

Posted

Site URL: https://www.davidwilson-brown.com/1288-productions

Hello,

I'm trying to resize the images on my index pages for mobile screens.  I've tried a few pieces of code in this thread, but I'm not sure if I'm grabbing the correct id.  Here's the code that I'm using and images for reference.  Thanks for the help.

Using Find Squarespace IDs and this is what I get:  #collection-62112bb786cd8c28fd38ee6f.  Am I supposed to include everything from this below, or just the id number itself?

@media screen and (max-width:767px) {
  [data-section-id=-62112bb786cd8c28fd38ee6f]{
    width: 100% !important;
    height: auto !important;
  }
}

image.thumb.png.93f8ead88bd1130611cf37924693ee54.png

 

image.thumb.png.cf66c0709ec55e014f83e38972724111.png

 

Posted

Add to Design > Custom CSS

@media screen and (max-width:640px) {
div#index-section-1288-about img {
    width: 100% !important;
    left: 0 !important;
    height: auto !important;
}
div#index-section-1288-about {
    height: 190px !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!)

Posted (edited)

@tuanphan Thank you so much.  I found out how to target that photo directly.  I am doing the same with other index photos on various pages.  

Now, I am ending up with gray space underneath similar to this post:

 

I used the suggestion you gave another user (code snippet is below)

/* resize home top mobile banner */

@media screen and (max-width:767px) {

  [data-section-id="60ce060627e9d9469bf70cc3"] { min-height:      unset !important; height: 60vh;

  }

}

but changed the data-section-ids to: 

#block-yui_3_17_2_1_1645499556465_11423

#block-yui_3_17_2_1_1645499556465_14164

which now reads:

@media screen and (max-width:767px) {

  [data-section-id="block-yui_3_17_2_1_1645499556465_11423"] { min-height:      unset !important; height: 60vh;

  }

 

[data-section-id="block-yui_3_17_2_1_1645499556465_14164"] { min-height:      unset !important; height: 60vh;

  }

}

This of course is not working.  I was wondering where you were getting the id from the dev tools.

Thanks again for your help.  I really appreciate it.

Edited by 1288webDevelopment
Posted
14 hours ago, 1288webDevelopment said:

@tuanphan Thank you so much.  I found out how to target that photo directly.  I am doing the same with other index photos on various pages.  

Now, I am ending up with gray space underneath similar to this post:

 

I used the suggestion you gave another user (code snippet is below)

/* resize home top mobile banner */

@media screen and (max-width:767px) {

  [data-section-id="60ce060627e9d9469bf70cc3"] { min-height:      unset !important; height: 60vh;

  }

}

but changed the data-section-ids to: 

#block-yui_3_17_2_1_1645499556465_11423

#block-yui_3_17_2_1_1645499556465_14164

which now reads:

@media screen and (max-width:767px) {

  [data-section-id="block-yui_3_17_2_1_1645499556465_11423"] { min-height:      unset !important; height: 60vh;

  }

 

[data-section-id="block-yui_3_17_2_1_1645499556465_14164"] { min-height:      unset !important; height: 60vh;

  }

}

This of course is not working.  I was wondering where you were getting the id from the dev tools.

Thanks again for your help.  I really appreciate it.

Use this tool to find data section 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!)

Posted

@tuanphan  Thank you so much.  I use that tool also, but I think I'm calling the wrong ID then.  There's still gray space underneath the footer.

Here's the code I'm using:

@media screen and (max-width:640px) {
div#index-section-1288-about img {
width: 100% !important;
left: 0 !important;
height: auto !important;
}
div#index-section-1288-about {
height: 190px !important;
}
div#index-section-paper-on-audio img {
width: 100% !important;
left: 0 !important;
height: auto !important;
}
div#index-section-paper-on-audio {
height: 190px !important;
}
  div#block-yui_3_17_2_1_1645499556465_14164{
    min-height: unset !important;
    height: 60vh;
}
}

image.thumb.png.4e9b59108417908bf13b215736a657dd.png

Posted
On 8/7/2022 at 1:16 PM, 1288webDevelopment said:

@tuanphan  Thank you so much.  I use that tool also, but I think I'm calling the wrong ID then.  There's still gray space underneath the footer.

Here's the code I'm using:

@media screen and (max-width:640px) {
div#index-section-1288-about img {
width: 100% !important;
left: 0 !important;
height: auto !important;
}
div#index-section-1288-about {
height: 190px !important;
}
div#index-section-paper-on-audio img {
width: 100% !important;
left: 0 !important;
height: auto !important;
}
div#index-section-paper-on-audio {
height: 190px !important;
}
  div#block-yui_3_17_2_1_1645499556465_14164{
    min-height: unset !important;
    height: 60vh;
}
}

image.thumb.png.4e9b59108417908bf13b215736a657dd.png

Try this new code

@media screen and (max-width: 640px) {
    div#index-section-1288-about img, div#index-section-paper-on-audio img {
        width: 100% !important;
        left: 0 !important;
        height: auto !important;
    }

    div#index-section-1288-about {
        height: 190px !important;
    }

    div#index-section-paper-on-audio {
        height: 200px;
    }
    div#index-section-paper-on-audio .index-item-text-wrapper.reveal-index-title {
    justify-content: flex-start;
}

body#collection-62112bb786cd8c28fd38ee6f, .index-section article {
    background-color: white !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!)

  • 2 weeks later...
Posted
On 8/10/2022 at 7:59 AM, tuanphan said:

Try this new code

@media screen and (max-width: 640px) {
    div#index-section-1288-about img, div#index-section-paper-on-audio img {
        width: 100% !important;
        left: 0 !important;
        height: auto !important;
    }

    div#index-section-1288-about {
        height: 190px !important;
    }

    div#index-section-paper-on-audio {
        height: 200px;
    }
    div#index-section-paper-on-audio .index-item-text-wrapper.reveal-index-title {
    justify-content: flex-start;
}

body#collection-62112bb786cd8c28fd38ee6f, .index-section article {
    background-color: white !important;
}
}

 

@tuanphan  Thank you so much for your help.

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.