Jump to content

Scale Mobile Banner With CSS

Recommended Posts

Site URL: https://koi-pufferfish-mn7c.squarespace.com/

Hi There,

I'm trying to figure out how to scale all the main banner images on the site. The code below worked on the home page but I don't know how to make it work on the other pages.

@media screen and (max-width:767px) {
body.homepage #page section:first-child {
    min-height: 20vh;
    margin-top: 10vh;
}
}

I'm open to any new ideas. Below is the site info:

https://koi-pufferfish-mn7c.squarespace.com/
pass: surf

Thank you.

Link to comment
  • Replies 21
  • Views 617
  • Created
  • Last Reply

Top Posters In This Topic

Repeat above code. Replace this

Quote

body.homepage #page section:first-child

with data section id.

use this tool to find 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!)

Link to comment

Thank you! I tried this code for the Charters page but it doesn't seem to be working...

@media screen and (max-width:767px) {
#block-249651d18bb132d522b0 {
    min-height: 20vh;
    margin-top: 10vh;
}
}

What have I done wrong?

Thanks again!

Link to comment
On 5/10/2021 at 7:11 PM, Shortline said:

Thank you! I tried this code for the Charters page but it doesn't seem to be working...

@media screen and (max-width:767px) {
#block-249651d18bb132d522b0 {
    min-height: 20vh;
    margin-top: 10vh;
}
}

What have I done wrong?

Thanks again!

Hi. Find data-section-id, not block-id. You are using block id.

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

Sorry...I must be doing something wrong. Here's what I have now:

@media screen and (max-width:767px) {
body.homepage #page section:first-child {
    min-height: 20vh;
    margin-top: 10vh;
}
}
@media screen and (max-width:767px) {
6096a6121354e120a42ddc08 {
    min-height: 20vh;
    margin-top: 10vh;
}
}

The https://koi-pufferfish-mn7c.squarespace.com/faqs is section 6096a6121354e120a42ddc08

I'm not sure what i've done wrong.

Thanks

Link to comment
14 hours ago, Shortline said:

Sorry...I must be doing something wrong. Here's what I have now:

@media screen and (max-width:767px) {
body.homepage #page section:first-child {
    min-height: 20vh;
    margin-top: 10vh;
}
}
@media screen and (max-width:767px) {
6096a6121354e120a42ddc08 {
    min-height: 20vh;
    margin-top: 10vh;
}
}

The https://koi-pufferfish-mn7c.squarespace.com/faqs is section 6096a6121354e120a42ddc08

I'm not sure what i've done wrong.

Thanks

Use this

Quote

[data-section-id="6096a6121354e120a42ddc08"]

 

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

Thank you. Now I'm getting a Syntax Error on line 8

@media screen and (max-width:767px) {
body.homepage #page section:first-child {
    min-height: 20vh;
    margin-top: 10vh;
}
}
@media screen and (max-width:767px) {
[data-section id="6096a6121354e120a42ddc08"] {
    min-height: 20vh;
    margin-top: 10vh;
}
}

What did I do wrong this time? 

Thank you

Link to comment
19 hours ago, Shortline said:

Thank you. Now I'm getting a Syntax Error on line 8

@media screen and (max-width:767px) {
body.homepage #page section:first-child {
    min-height: 20vh;
    margin-top: 10vh;
}
}
@media screen and (max-width:767px) {
[data-section id="6096a6121354e120a42ddc08"] {
    min-height: 20vh;
    margin-top: 10vh;
}
}

What did I do wrong this time? 

Thank you

Can you send all code in Custom CSS?

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

This is all I have for CSS

@media screen and (max-width:767px) {
body.homepage #page section:first-child {
    min-height: 20vh;
    margin-top: 10vh;
}
}
@media screen and (max-width:767px) {
[data-section id="6096a6121354e120a42ddc08"] {
    min-height: 20vh;
    margin-top: 10vh;
}
}

 

Thank you.

Link to comment
23 hours ago, Shortline said:

This is all I have for CSS

@media screen and (max-width:767px) {
body.homepage #page section:first-child {
    min-height: 20vh;
    margin-top: 10vh;
}
}
@media screen and (max-width:767px) {
[data-section id="6096a6121354e120a42ddc08"] {
    min-height: 20vh;
    margin-top: 10vh;
}
}

 

Thank you.

Remove all, use this

@media screen and (max-width:767px) {
[data-section id="6096a6121354e120a42ddc08"] {
    min-height: 20vh;
    margin-top: 10vh;
}
}

 

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

The home page not scales properly but not the other pages. Here's the CCS code right now:

@media screen and (max-width: 767px) {
    body.homepage article section:first-child {
        min-height: unset !important;
        margin-top: 10vh;
    }
}
@media screen and (max-width:767px) {
[data-section-id="6096a6121354e120a42ddc08"] {
    min-height: 20vh;
    margin-top: 10vh;
}
}

 

I've also tried only this CSS:

@media screen and (max-width: 767px) {
    body.homepage article section:first-child {
        min-height: unset !important;
        margin-top: 10vh;
    }
}

Neither seems to work.

Thanks

Link to comment
On 5/29/2021 at 12:34 AM, Shortline said:

The home page not scales properly but not the other pages. Here's the CCS code right now:

@media screen and (max-width: 767px) {
    body.homepage article section:first-child {
        min-height: unset !important;
        margin-top: 10vh;
    }
}
@media screen and (max-width:767px) {
[data-section-id="6096a6121354e120a42ddc08"] {
    min-height: 20vh;
    margin-top: 10vh;
}
}

 

I've also tried only this CSS:

@media screen and (max-width: 767px) {
    body.homepage article section:first-child {
        min-height: unset !important;
        margin-top: 10vh;
    }
}

Neither seems to work.

Thanks

I see it worked here?

image.thumb.png.ab4bb332b0a7793b1b85743c12463219.png

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

Add to Design > Custom CSS

/* Mobile-Banner */
@media screen and (max-width:767px) {
/* Charters */
[data-section-id="609685032896e65339e3a8e2"] {
    min-height: unset !important;
    height: 35vh;
    margin-top: 5vh;
}
/* faqs */
[data-section-id="6096a6121354e120a42ddc08"] {
    min-height: unset !important;
}
/* covid */
[data-section-id="6096a6f57dc7db684ff74aef"] {
    min-height: unset !important;
    height: 35vh;
}
/* contact */
[data-section-id="6096aa30cc694952d8338089"] {
    min-height: unset !important;
    height: 35vh;
    margin-top: 5vh;
}

}

 

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
On 6/3/2021 at 7:29 PM, Shortline said:

AWESOME! All the banners look perfect.

Thanks for taking the time to help me.

Much appreciated.

Do you need support with these?

Site URL – https://koi-pufferfish-mn7c.squarespace.com/

1. (Mobile-Footer) Reduce logo size?

koi-pufferfish-mn7c.squarespace.com-01-m

2. (Tablet-Homepage) Resize image?

koi-pufferfish-mn7c.squarespace.com-02-m

3. (Overlay Menu) Change logo color?

koi-pufferfish-mn7c.squarespace.com-03-m

4. (Tablet-FAQs) Increase content width?

koi-pufferfish-mn7c.squarespace.com-04-m

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.