• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here: Home » External Link Icon With Hover With Base64 Data URI and CSS

By Abhishek Ghosh August 24, 2020 10:32 am Updated on August 24, 2020

External Link Icon With Hover With Base64 Data URI and CSS

Advertisement

Many of the webmasters and bloggers want to add a Wikipedia style external link icon to some of the external links. It is obvious matter that using a transparent image for this kind of external link icon increases one HTTP request. We have an old guide on how to use a transparent image to add an icon beside the external links for the effect. In short, the method for it was using a CSS like below :

Vim
1
2
3
4
5
6
7
8
9
10
<style>
a[target="_blank"]:after {
content: url(you-image-link-here);
margin: 0 3px 0 5px;
display: inline-block;
opacity: 1;
-moz-opacity: 1;
filter:alpha(opacity=100);
}
</style>

External Link Icon With Hover With Base64 Data URI and CSS

Now, about the methods to get the equivalent effect with Base64 Data URI instead of URI of an image. If your website is example.com and you have a link on your text towards thecustomizewindows.com then the below CSS snippet will give you an icon beside your link towards thecustomizewindows.com :

Vim
1
2
3
4
5
<style>
a[href ^= "http://thecustomizewindows.com"]:after {
     content: " " url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAVklEQVR4Xn3PgQkAMQhDUXfqTu7kTtkpd5RA8AInfArtQ2iRXFWT2QedAfttj2FsPIOE1eCOlEuoWWjgzYaB/IkeGOrxXhqB+uA9Bfcm0lAZuh+YIeAD+cAqSz4kCMUAAAAASUVORK5CYII=);    
}
</style>

If your website is example.com and you want an icon beside your all external links then the snippet will go like this :

Advertisement

---

Vim
1
2
3
4
5
<style>
a[href ^= "http"]:after {
     content: " " url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAVklEQVR4Xn3PgQkAMQhDUXfqTu7kTtkpd5RA8AInfArtQ2iRXFWT2QedAfttj2FsPIOE1eCOlEuoWWjgzYaB/IkeGOrxXhqB+uA9Bfcm0lAZuh+YIeAD+cAqSz4kCMUAAAAASUVORK5CYII=);    
}
</style>

In both of the cases, links towards your own domain should be relative :

Vim
1
<a href="/2020/04/" target="_blank" title="Create external links with an icon beside like Wikipedia">our archive of April 2020</a>

Live version of the above HTML : our archive of April 2020.

Now, many of the webmasters and web designers want some hover effect with the above trick. We can invert on hover :

Vim
1
2
3
4
5
6
7
8
9
10
<style>
a[href ^= "http"]:after {
     content: " " url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAVklEQVR4Xn3PgQkAMQhDUXfqTu7kTtkpd5RA8AInfArtQ2iRXFWT2QedAfttj2FsPIOE1eCOlEuoWWjgzYaB/IkeGOrxXhqB+uA9Bfcm0lAZuh+YIeAD+cAqSz4kCMUAAAAASUVORK5CYII=);    
}
 
a:hover[href ^= "http"]:after{
    -webkit-filter: invert(1);
  filter: invert(1);
}
</style>

Here is the live example on JsFiddle. Click the “Result” tab and hover over the link on the line “Here is an absolute link” :

The above method is not visually the best but it is a demonstration of an easy trick avoiding to use a different base64 encoding for another image which is of a different colour. Data URIs does not work in IE 5-7 but are supported in IE 8. To solve this, you can use an IE-only stylesheet to put images.

This is the GitHub Gist of this trick.

This Article Has Been Shared 892 Times!

Facebook Twitter Pinterest
Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Orthopaedic Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to External Link Icon With Hover With Base64 Data URI and CSS

  • Checklist to choose a perfect WordPress theme

    We are providing a thorough detailed checklist those are need to be checked, before selecting a Wordpress theme.

  • Free Blogging options : Advantages of WordPress over Blogger

    WordPress has some advantages over Blogger. We’ve compared Free WordPress blog with Google’s Blogger blog in simple words for any level of users fumbling to choose between WordPress and Blogger.

  • MaxCDN versus Rackspace Cloud Files : Head to Head Test and Result

    MaxCDN versus Rackspace Cloud Files – NetDNA versus Akamai. Let us see the test and result in our own eyes to speed up our WordPress setup.

  • Repairing WordPress Database : Using Cloud Database Server

    Repairing WordPress Database is easy by using Cloud Database Server like from The Rackspace Cloud which provides MySQL database server with PHPmyAdmin software.

  • Making WordPress to Load Faster on Rackspace Cloud Sites

    Making WordPress to Load Faster on Rackspace Cloud Sites needs WP Super Cache,CDN Sync Tool, HyperDB, .htaccess tricks and tweaks to make buggy plugins working.

Additionally, performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

You can subscribe to our Free Once a Day, Regular Newsletter by clicking the subscribe button below.

Click To Subscribe

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (21K Followers)
  • Twitter (5.3k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • 5 Sectors That Have Undergone Revamps in Digital Landscape February 24, 2021
  • What You Can Control with a Smartwatch and ESP32 February 23, 2021
  • What Does Data Cleansing Mean? February 21, 2021
  • How to Find the Right Software for Your Company February 20, 2021
  • What is Code Refactoring? February 19, 2021

 

About This Article

Cite this article as: Abhishek Ghosh, "External Link Icon With Hover With Base64 Data URI and CSS," in The Customize Windows, August 24, 2020, February 25, 2021, https://thecustomizewindows.com/2020/08/external-link-icon-with-hover-with-base64-data-uri-and-css/.

Source:The Customize Windows, JiMA.in

 

This website uses cookies. If you do not want to allow us to use cookies and/or non-personalized Ads, kindly clear browser cookies after closing this webpage.

Read Cookie Policy.

PC users can consult Corrine Chorney for Security.

Want to know more about us? Read Notability and Mentions & Our Setup.

Copyright © 2021 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy