Site logo

[Resolved] Style external links

Home Forums Support [Resolved] Style external links

Home Forums Support Style external links

  • This topic has 5 replies, 2 voices, and was last updated 5 years ago by Leo.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1704090
    Atefan

    Hello,

    I found one code, that seems to do the job, I like to archive, to style external links.

    
    a[href*="//"]:not([href*="mywebsite.com"]):after{
        content: " " url("https://developer.mozilla.org/static/general/external-link.fb3c293b9226.svg");   
    }

    from https://codepen.io/olegip/pen/KLxdME

    But, how to exclude now social icons?
    when I add the css code 2 times, with another URL, it does not work.
    any idea?
    instead of the SVG icon, it could have written (EXTERNAL) only too.

    somebody now?
    Thanks

    #1704217
    Leo
    Staff
    Customer Support

    Hi there,

    Any chance you can link us to the site in question?

    You can use the private information field.

    Let me know 🙂

    #1704223
    Atefan

    sure

    #1704271
    Leo
    Staff
    Customer Support

    This isn’t really a theme-related question.

    I think the best solution is to add a custom class to the external links so you can target your CSS to those links only.

    #1704471
    Atefan

    Sure.

    But I hope it helps others, who are SEO concern.

    a[href*="//"]:not([href*="mywebsite.com"]):not([href*="youtube.com"]):not([href*="linkedin.com"]):not([href*="printerest.com"]):not([href*="facebook.com"]):not([href*="instagram.com"]):after{
        content: " " url("https://developer.mozilla.org/static/general/external-link.fb3c293b9226.svg");   
    }
    #1705688
    Leo
    Staff
    Customer Support

    Thanks for sharing!

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.