• 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 474 Times!

Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, 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

Get new posts by email:

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 (24.3K Followers)
  • Twitter (5.8k 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

  • Cyberpunk Aesthetics: What’s in it Special January 27, 2023
  • How to Do Electrical Layout Plan for Adding Smart Switches January 26, 2023
  • What is a Data Mesh? January 25, 2023
  • What is Vehicular Ad-Hoc Network? January 24, 2023
  • Difference Between Panel Light, COB Light, Track Light January 21, 2023

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, January 29, 2023, https://thecustomizewindows.com/2020/08/external-link-icon-with-hover-with-base64-data-uri-and-css/.

Source:The Customize Windows, JiMA.in

PC users can consult Corrine Chorney for Security.

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

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

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

We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Do not sell my personal information.
Cookie SettingsAccept
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT