Create external links with an icon beside like Wikipedia


External links, that is to say the links that point to different sites from that of current site, should be reported properly as recommended by the W3C. This provides useful information to visitors while reading an article. Unfortunately this system is rarely implemented. The only known site that uses it is Wikipedia with a small icon:

 

securitygarden on Wikipedia

Corrine's Garden is shown as external link in Wikipedia

 

In the above screenshot from Wikipedia reference, you can see respected Corrine’s blog as well as other external links are shown with typical icon beside each links.

 

 

This little trick is easily implemented using CSS rules. To begin we must add two properties to the CSS rule for hyperlinks:

a{
:url("external.png") no-repeat scroll right top transparent;
padding:0 13px 0 0;
}

Nothing more simple, we add here an icon that is named external.png in the background of all the links. The padding is to shift the text in relation to the icon so they do not overlap.

Just now cancel the same rule for links that are not actually external links using attribute selectors in CSS:

a{
background:url("external.png") no-repeat scroll right top transparent;
padding:0 13px 0 0;
}
a[href*="blogname"]{
padding: 0;
background: none;
}

The second rule allows to specify new properties to links that contain the href attribute in the domain of our site. Here we the padding and background . Texts made red should be changed.

Resource icons for external links

 

Right click to save them:

 

external_link_iconicon_external_linkIcon_External_Linkicon_external_link_on


Note: Some are gif images, so remember to both the name and extension in your CSS code.

 

Using external links with an icon for single page or post using span

 

As like our previous post, we can use the method for a single post or link too. But, the image must be in images folder of the current theme (to the URI path without http). The code becomes big though!

 

Is there available?

 

Sure. WP External Links can handle and add icons.

 

Signature


If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

Leave Lame Behind - Get Engaged

Here’s what we’ve got for you:

Contact Us Today for Smarter Marketing of Knowledge

See each of the premium resources below:

For Publishers and Content Owners

Do you want to optimize your available content?

Do you want to increase the visibility of your content?

Do you want to increase your reliability as an Author?

Do you want your next or existing project to be technically planned?

If your answer to any of these is YES contact us with your approximate budget.

Contact Us Today

For the Media Companies and Advertisers

You must be seeking a publisher website like ours with real content to give an exposure to your client's business?

We provide Industry's Standard opportunities for advertisement.

Do you want some promotion that comes with proper invoicing, SLA on per annum basis?

If your answer is YES contact us today for a quote.

Contact Us Today for Quote

Comments

Mentions

  1. [...] if you refer to a post from another blog and your articles it let that know the reader. How?  We wrote an interesting article on marking external link with an arrow mark like Wikipedia. You can try it. You will ask why we are not using it? The icon overrides our external links in the [...]

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>