Jump to content

Custom social media icons not displaying on mobile

Recommended Posts

Posted

Site URL: https://commiecoin.net

Hi! I have added the following snippet to add a custom icon to my social media icons:

/* remove current icon */
.header-actions-action--social a:last-child svg {
    display: none;
}


/* set new icon */
.header-actions-action--social a:last-child {
    background-image: url(https://i.ibb.co/bbwYLMY/telegram-app.png);
    background-size: cover;
    background-repeat: no-repeat;
}

It works correctly on the desktop version, but in mobile it just displays a default 'link' icon. Any ideas how to fix this?

I've tried adding the media rule, but that didn't fix it either:

@media screen and (max-width:480px) {
.header-actions-action--social a:last-child svg {
    display: none;
}
}

@media screen and (max-width:480px) {
.header-actions-action--social a:last-child {
    background-image: url(https://i.ibb.co/bbwYLMY/telegram-app.png);
    background-size: cover;
    background-repeat: no-repeat;
}
}

 

  • Replies 2
  • Views 756
  • Created
  • Last Reply
Posted

It looks like you solved with this code?

@media only screen and (min-width: 640px) {
    .icon--fill:nth-of-type(3) {
        background-image:url(https://svgur.com/i/Ww7.svg);
        background-size: 100%;
        background-repeat: no-repeat
    }

    .icon--fill:nth-of-type(3) svg {
        display: none
    }
}

.header-menu-actions-action:nth-of-type(3) {
    background-image: url(https://svgur.com/i/Ww7.svg);
    background-size: 100%;
    background-repeat: no-repeat
}

.header-menu-actions-action:nth-of-type(3) svg {
    display: none
}

 

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!)

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.