Jump to content

Is it possible to have different images on the mobile version of the website and desktop version?

Go to solution Solved by tuanphan,

Recommended Posts

On 8/9/2023 at 4:19 PM, NikkiBF said:

Thanks, site is: https://seal-iris-c537.squarespace.com/

pw is Sp0tlight!

Use this code to Design > Custom CSS (or Website > Website Tools > Custom CSS). Replace Pixabay with your image url

/* Mobile list new images */
@media screen and (max-width:767px) {
.user-items-list-item-container[data-section-id="64aae19ad6aec51b5ebf0447"] {
	li:nth-child(1) img {
    content: url(https://cdn.pixabay.com/photo/2023/08/07/13/44/tree-8175062_1280.jpg);
}
li:nth-child(2) img {
    content: url(https://cdn.pixabay.com/photo/2023/07/27/03/27/fireworks-8152353_1280.jpg);
}
li:nth-child(3) img {
    content: url(https://cdn.pixabay.com/photo/2023/07/26/15/38/frog-8151540_1280.jpg);
}}}

 

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 8/15/2023 at 11:12 AM, tuanphan said:

Use this code to Design > Custom CSS (or Website > Website Tools > Custom CSS). Replace Pixabay with your image url

/* Mobile list new images */
@media screen and (max-width:767px) {
.user-items-list-item-container[data-section-id="64aae19ad6aec51b5ebf0447"] {
	li:nth-child(1) img {
    content: url(https://cdn.pixabay.com/photo/2023/08/07/13/44/tree-8175062_1280.jpg);
}
li:nth-child(2) img {
    content: url(https://cdn.pixabay.com/photo/2023/07/27/03/27/fireworks-8152353_1280.jpg);
}
li:nth-child(3) img {
    content: url(https://cdn.pixabay.com/photo/2023/07/26/15/38/frog-8151540_1280.jpg);
}}}

 

Thank you so much. That's amazing!

Is there any chance you could do it for the image further down on that page - underneath 'solving your problems'?

Thanks again.

Link to comment
21 hours ago, NikkiBF said:

Thank you so much. That's amazing!

Is there any chance you could do it for the image further down on that page - underneath 'solving your problems'?

Thanks again.

Use this new code

/* Mobile list new images */
@media screen and (max-width:767px) {
.user-items-list-item-container[data-section-id="64aae19ad6aec51b5ebf0447"] {
	li:nth-child(1) img {
    content: url(https://cdn.pixabay.com/photo/2023/08/07/13/44/tree-8175062_1280.jpg);
}
li:nth-child(2) img {
    content: url(https://cdn.pixabay.com/photo/2023/07/27/03/27/fireworks-8152353_1280.jpg);
}
li:nth-child(3) img {
    content: url(https://cdn.pixabay.com/photo/2023/07/26/15/38/frog-8151540_1280.jpg);
}}
/* solving your problems image */
div#block-08deb4d889d890174909 img {
	content: url(https://cdn.pixabay.com/photo/2023/07/27/03/27/fireworks-8152353_1280.jpg);
}}

 

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, I am having a similar issue. I want a different image displayed on the mobile version than to my desktop. I was able to do this but now the images seem to be cut from the top and bottom, making it look narrower. 

The images are the text message box and project filter. 

my website is: dharamistry.ca

This is the code I used:

@media screen and (max-width:767px) {
div#block-yui_3_17_2_1_1692417960012_5637 img {
    content: url(https://static1.squarespace.com/static/6429f3c0cdf19824d12c4bd9/t/64e0fc23b71d18560d3da670/1692466211285/Group+47.png);
    height: auto !important;
      top: 50% !important;
    transform: translateY(-50%);
}
  
div#block-yui_3_17_2_1_1692310337056_21015 img{
    content: url(https://static1.squarespace.com/static/6429f3c0cdf19824d12c4bd9/t/64e0f5ca4bcf6260506b359e/1692464586733/Group+46.png);
    height: auto !important;
     top: 50% !important;
    transform: translateY(-50%);
}
}

 

Please let me know how to fix this. 

Thank you!

 

Link to comment
7 hours ago, dm23 said:

Hi, I am having a similar issue. I want a different image displayed on the mobile version than to my desktop. I was able to do this but now the images seem to be cut from the top and bottom, making it look narrower. 

The images are the text message box and project filter. 

my website is: dharamistry.ca

This is the code I used:

@media screen and (max-width:767px) {
div#block-yui_3_17_2_1_1692417960012_5637 img {
    content: url(https://static1.squarespace.com/static/6429f3c0cdf19824d12c4bd9/t/64e0fc23b71d18560d3da670/1692466211285/Group+47.png);
    height: auto !important;
      top: 50% !important;
    transform: translateY(-50%);
}
  
div#block-yui_3_17_2_1_1692310337056_21015 img{
    content: url(https://static1.squarespace.com/static/6429f3c0cdf19824d12c4bd9/t/64e0f5ca4bcf6260506b359e/1692464586733/Group+46.png);
    height: auto !important;
     top: 50% !important;
    transform: translateY(-50%);
}
}

 

Please let me know how to fix this. 

Thank you!

 

Replace the code with the code below.

@media screen and (max-width:767px) {
  div#block-yui_3_17_2_1_1692417960012_5637 img {
    content: url(https://static1.squarespace.com/static/6429f3c0cdf19824d12c4bd9/t/64e0fc23b71d18560d3da670/1692466211285/Group+47.png);
    height: auto !important;
    top: 50% !important;
    transform: translateY(-50%);
  }
  div#block-yui_3_17_2_1_1692310337056_21015 img{
    content: url(https://static1.squarespace.com/static/6429f3c0cdf19824d12c4bd9/t/64e0f5ca4bcf6260506b359e/1692464586733/Group+46.png);
    height: auto !important;
    top: 50% !important;
    transform: translateY(-50%);
  }
  div#block-yui_3_17_2_1_1692417960012_5637, div#block-yui_3_17_2_1_1692310337056_21015 {
    .sqs-image-content {
      height: 100% !important;
    }
  }
}

 

Screenshot_143.png

If my comments are useful, please like and mark my solution as answer. It will encourage me. Thanks

MD Rofik
Website Designer and Digital Marketer

Am I helpful? Want to offer me a coffee?
Send me a message if needed any help. I'll try to reply as soon as possible.


 

Link to comment
On 8/19/2023 at 10:29 AM, tuanphan said:

Use this new code

/* Mobile list new images */
@media screen and (max-width:767px) {
.user-items-list-item-container[data-section-id="64aae19ad6aec51b5ebf0447"] {
	li:nth-child(1) img {
    content: url(https://cdn.pixabay.com/photo/2023/08/07/13/44/tree-8175062_1280.jpg);
}
li:nth-child(2) img {
    content: url(https://cdn.pixabay.com/photo/2023/07/27/03/27/fireworks-8152353_1280.jpg);
}
li:nth-child(3) img {
    content: url(https://cdn.pixabay.com/photo/2023/07/26/15/38/frog-8151540_1280.jpg);
}}
/* solving your problems image */
div#block-08deb4d889d890174909 img {
	content: url(https://cdn.pixabay.com/photo/2023/07/27/03/27/fireworks-8152353_1280.jpg);
}}

 

I've tried that and it doesn't seem to work. I don't seem to have got the others one working either (thought I had - sorry). Could you please check and tell me what I have done wrong?

thanks so much - really appreciate this!

Link to comment
24 minutes ago, NikkiBF said:

I've tried that and it doesn't seem to work. I don't seem to have got the others one working either (thought I had - sorry). Could you please check and tell me what I have done wrong?

thanks so much - really appreciate this!

 

Did you replace your code with the code below?

@media screen and (max-width:767px) {
  div#block-yui_3_17_2_1_1692417960012_5637 img {
    content: url(https://static1.squarespace.com/static/6429f3c0cdf19824d12c4bd9/t/64e0fc23b71d18560d3da670/1692466211285/Group+47.png);
    height: auto !important;
    top: 50% !important;
    transform: translateY(-50%);
  }
  div#block-yui_3_17_2_1_1692310337056_21015 img{
    content: url(https://static1.squarespace.com/static/6429f3c0cdf19824d12c4bd9/t/64e0f5ca4bcf6260506b359e/1692464586733/Group+46.png);
    height: auto !important;
    top: 50% !important;
    transform: translateY(-50%);
  }
  div#block-yui_3_17_2_1_1692417960012_5637, div#block-yui_3_17_2_1_1692310337056_21015 {
    .sqs-image-content {
      height: 100% !important;
    }
  }
}

 

If my comments are useful, please like and mark my solution as answer. It will encourage me. Thanks

MD Rofik
Website Designer and Digital Marketer

Am I helpful? Want to offer me a coffee?
Send me a message if needed any help. I'll try to reply as soon as possible.


 

Link to comment
  • 1 month later...
On 10/8/2023 at 12:28 AM, JordanWH said:

Hi. My website is www.many-seeds.com and I want to have a different version of the YOU + 15 Seconds on mobile vs desktop. Can you help? Big thanks in advance.

Where is YOU+..? I don't see it on homepage

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 10/10/2023 at 12:25 AM, JordanWH said:

My apologies. It's on the supporters page. www.many-seeds.com/supporters

You can add this to Website Tools (under Not Linked) > Custom CSS to replace it with new image on mobile

/* you+ 15 on mobile */
@media screen and (max-width:767px) {
div#block-yui_3_17_2_1_1696540427469_2540 img {
    content: url(https://cdn.pixabay.com/photo/2023/03/07/10/04/clamshell-orchid-7835395_1280.jpg);
}}

Replace pixabay image with new image url

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 10/12/2023 at 6:41 AM, tuanphan said:

You can add this to Website Tools (under Not Linked) > Custom CSS to replace it with new image on mobile

/* you+ 15 on mobile */
@media screen and (max-width:767px) {
div#block-yui_3_17_2_1_1696540427469_2540 img {
    content: url(https://cdn.pixabay.com/photo/2023/03/07/10/04/clamshell-orchid-7835395_1280.jpg);
}}

Replace pixabay image with new image url

Thanks that worked to get the right image on the mobile page. It displays very small on mobile though when it's set to fit and if I change it to fill the sides are cut off and it cuts the sides off the image on desktop as well. Is there anything I can do to fix that? Thanks sincerely for your help.

Link to comment
On 10/14/2023 at 10:01 AM, JordanWH said:

Thanks that worked to get the right image on the mobile page. It displays very small on mobile though when it's set to fit and if I change it to fill the sides are cut off and it cuts the sides off the image on desktop as well. Is there anything I can do to fix that? Thanks sincerely for your help.

Use this new code

/* you+ 15 on mobile */
@media screen and (max-width:767px) {
div#block-yui_3_17_2_1_1696540427469_2540 img {
    content: url(https://cdn.pixabay.com/photo/2023/03/07/10/04/clamshell-orchid-7835395_1280.jpg);
    object-fit: cover !important;
    height: auto !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!)

Link to comment
17 hours ago, tuanphan said:

Use this new code

/* you+ 15 on mobile */
@media screen and (max-width:767px) {
div#block-yui_3_17_2_1_1696540427469_2540 img {
    content: url(https://cdn.pixabay.com/photo/2023/03/07/10/04/clamshell-orchid-7835395_1280.jpg);
    object-fit: cover !important;
    height: auto !important;
}}

 

Got it working with that one. Thank you very much for your help!!

Link to comment
  • 2 weeks later...

Hi there! 

I'm trying to get the hero text image on this website (https://drmichelleweiner.squarespace.com/ pw: MW2023!) to be different on mobile. I've figured most of it out through the assistance of ChatGPT and this thread,  but now, I'm encountering difficulties with both the Hero image as well as the Hero Image text. I need to change the hero image to a vertical image and I need the hero image text to disappear on mobile. 

Basically, I need a different hero image and mobile text image for both mobile and desk top. I tried the coding outlined here in this thread, but I encountered the mobile image being too small or not showing up entirely because the desktop image is much longer. So, I tried adding a different image block to show once in mobile. However, here- the desktop image will not disappear, it still shows on mobile. Screenshot also included in this post. 

The code I used for the current formatting is below (please help me include coding to change the hero image on mobile- my client's face is cut off: 

/* Dr MW Hero Text - Desktop */
div#block-yui_3_17_2_1_1698275164210_47548 img.desktop-image {
    content: url(https://images.squarespace-cdn.com/content/64fb8378a809ea11c70c62dc/c6c012ae-1e86-4c7b-b008-9b4bd68d218e/Dr+Michelle+Weiner+Pain+Expert.png?content-type=image%2Fpng);
  
}

/* Dr MW Hero Text - Mobile */
@media screen and (max-width: 767px) {
    div#block-yui_3_17_2_1_1698275164210_47548 img.desktop-image {
        display: none !important;
    }
    div#block-yui_3_17_2_1_1698703169827_36238 {
        content: url(https://images.squarespace-cdn.com/content/64fb8378a809ea11c70c62dc/5e93fa51-be35-402d-8461-4ccc29adfd1f/Dr+MW+Pain+Expert+Text+Hero+Mobile%402x.png?content-type=image%2Fpng);
        object-fit: fill !important;
        height: auto !important;
    }
}

 

Screen Shot 2023-10-30 at 5.56.20 PM.png

Edited by CoulterCreativeCo
Link to comment
On 10/31/2023 at 5:26 AM, CoulterCreativeCo said:

Hi there! 

I'm trying to get the hero text image on this website (https://drmichelleweiner.squarespace.com/ pw: MW2023!) to be different on mobile. I've figured most of it out through the assistance of ChatGPT and this thread,  but now, I'm encountering difficulties with both the Hero image as well as the Hero Image text. I need to change the hero image to a vertical image and I need the hero image text to disappear on mobile. 

Basically, I need a different hero image and mobile text image for both mobile and desk top. I tried the coding outlined here in this thread, but I encountered the mobile image being too small or not showing up entirely because the desktop image is much longer. So, I tried adding a different image block to show once in mobile. However, here- the desktop image will not disappear, it still shows on mobile. Screenshot also included in this post. 

The code I used for the current formatting is below (please help me include coding to change the hero image on mobile- my client's face is cut off: 

/* Dr MW Hero Text - Desktop */
div#block-yui_3_17_2_1_1698275164210_47548 img.desktop-image {
    content: url(https://images.squarespace-cdn.com/content/64fb8378a809ea11c70c62dc/c6c012ae-1e86-4c7b-b008-9b4bd68d218e/Dr+Michelle+Weiner+Pain+Expert.png?content-type=image%2Fpng);
  
}

/* Dr MW Hero Text - Mobile */
@media screen and (max-width: 767px) {
    div#block-yui_3_17_2_1_1698275164210_47548 img.desktop-image {
        display: none !important;
    }
    div#block-yui_3_17_2_1_1698703169827_36238 {
        content: url(https://images.squarespace-cdn.com/content/64fb8378a809ea11c70c62dc/5e93fa51-be35-402d-8461-4ccc29adfd1f/Dr+MW+Pain+Expert+Text+Hero+Mobile%402x.png?content-type=image%2Fpng);
        object-fit: fill !important;
        height: auto !important;
    }
}

 

Screen Shot 2023-10-30 at 5.56.20 PM.png

Hi,

It looks like you figured it out?

image.png.c15577ddcec99f6b91f2810ce5f4897a.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
  • 1 month later...

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.