Jump to content

DIFFERENT BACKGROUND IMAGE FOR MOBILE VERSION

Recommended Posts

Hi,

 

I want to have a different image for the mobile version of my landing page. The desktop image is a landscape format image that fits great, but when on mobile, it looks weird. I would like to use CSS code to make a different image appear in the background when on mobile.

Thanks

Link to comment
  • Replies 12
  • Views 1.6k
  • Created
  • Last Reply

Top Posters In This Topic

On 3/28/2024 at 7:12 AM, cariboustudio said:

Hi,

Sure, here is the link : www.caribou.studio

Thanks!

You mean the kid image on top of page? You can use this code to Website > Website Tools > Custom CSS

@media screen and (max-width:991px) {
[data-section-id="6606d1401a1965585d987265"] {
    min-height: unset !important;
    height: 60vh;
}
}

This code will resize image on mobile, but if you need code to replace with new image, let me know, I will give another code.

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

Hi, thanks for the code. 

And yes, I want to replace with a different image. I managed to do it by creating different sections and display only one on mobile and the other on desktop. But if you know a simpler code, that would be great. I wouldn't have to create different sections in the future.

Link to comment
On 4/1/2024 at 10:54 PM, cariboustudio said:

Hi, thanks for the code. 

And yes, I want to replace with a different image. I managed to do it by creating different sections and display only one on mobile and the other on desktop. But if you know a simpler code, that would be great. I wouldn't have to create different sections in the future.

You can send me image file, I can give code to replace desktop image with this image on mobile, so need to need to create a second section

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 4/9/2024 at 11:36 PM, cariboustudio said:

Hi,

 

It works fine this way. But if you have a code that would allow me to have only one section, but different images on mobile versus desktop, I would like to know it. Thank you!

You can duplicate the page & share link to duplicated page, I can give code for this page, then if it works, I will adjust code for main page

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 4/16/2024 at 11:03 PM, cariboustudio said:

OK, I duplicated the page and here is the link to the copy : https://caribou.studio/home-1

Use this code to Website > Website Tools > Custom CSS

@media screen and (max-width:767px) {
[data-section-id="661ea105dada2b0e8477b680"] img {
    content: url(https://content.invisioncic.com/p289038/monthly_2024_04/caribou-PE24-background-mobile.thumb.jpg.9ced126e830618173bd5175548d5a9cc.jpg);
}
}

image.png.21ca8f8d1ea5dde60bde9b32adfb054e.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

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.