Rules

Secret ingredients to quality software

Edit
Info

Do you visually indicate when a link is external?

Created on 16 Feb 2015 | Last updated by Brady Stroud [SSW] on 18 Apr 2021 10:45 PM (4 days ago)

When creating links, you should follow a few basic rules:

  • If your link is an internal link, then it should keep the default behaviour, navigating within the same tab
  • If the link is external, it should:

    • Open in a new tab
    • Be visually clear to the user that it will lead them away from the current site, that way it is not a surprise.

Google is by far the best but try other search engines as well.

Figure: Bad example - Without visual indication

Google is by far the best but try other search engines as well.

Figure: Good example - With visual indication

How to add the external link indicator?

It should be inserted by CSS as following:

a[href*="//"]:not([href*="mysite.com"]):after {
content: url(https://www.ssw.com.au/ssw/images/external.gif);     
padding-left: 4px;
}

Figure: Icon can be added via CSS using a simple declaration

Adam CoganAdam Cogan
Tiago AraujoTiago Araujo

We open source. This page is on GitHub