Wildlink's Technology Blog

An occasionally updated list of informative articles.
Pulled from our internal wiki.

CSS - Add an external link signifier

Article Information

Article Content

Simple one today.

You can have CSS automatically add an external link signifier to any external URL

    <a href="https://external_url">External URL</a>

with the following CSS

a[href^="http://"], a[href^="https://"]  {
    background: url("<PATH TO IMAGE>") center right no-repeat;
    padding-right: 1em;
}