Jump to content

Replacing a specific image for mobile view

Recommended Posts

Hello,

I'm having a few problems with one of my clients' website.

She would like a different version of her logo to be on a mobile view, I have tried some code but the image isn't showing in full.

I've used this code:


@media screen and (max-width:767px) {
div#block-yui_3_17_2_1_1692109429145_3484 img {
    content: url(https://static1.squarespace.com/static/62681359eb930e7e05951164/t/659f02656aaf303002d9c892/1704919653971/Clare_Logo_Dev_Final-06.png);
    height: auto !important;
    top: 0% !important;
    padding-bottom: 0% !important;
    transform: translateY(-50%);
}
}
 

But this is how the image is showing?

image.png.76446fe2c8a25d1d68e3cda98c97f4f4.png

 

It's meant to be like this...

image.png.6a2d910940da3bb8ee421d2c8053f8a9.png

 

What bit of code am I missing, to show this logo in full, but to still keep the logo the same on desktop?

PW: Dodger50!
https://rectangle-cardioid-z6nt.squarespace.com/config/?frameUrl=%2F

 

Thanks in advance,
Ruth

 

Link to comment
  • Replies 2
  • Views 1.2k
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

You can use this CSS code

@media screen and (max-width: 767px) {
    div#block-yui_3_17_2_1_1692109429145_3484 img {
        content:url(https://static1.squarespace.com/static/62681359eb930e7e05951164/t/659f02656aaf303002d9c892/1704919653971/Clare_Logo_Dev_Final-06.png);
        position: static !important;
    }
div#block-yui_3_17_2_1_1692109429145_3484 .fluid-image-container {
    overflow: visible !important;
    height: auto !important;
}
}

image.png.e6f4f907bccf9d3b2b6f10aaeecb1773.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.