Code Snippets

Code Snippets

Here is a growing list of code snippets, in HTML, CSS and JavaScript, that you can add to your website to enhance it.

Many of these solutions came from our own needs.

How to Add Social Media Icons to Links Using CSS

There are several ways to automatically add social media icons to links via CSS.

The best way is using a unique class for each social media site, but if you are using a content management system (CMS) that generates the HTML for you, that may not always be possible. In that case, we have included a couple other ways to do the same thing.


Regardless of the method used below, the links will all look like this:


How to Add an Icon to Links using CSS

Sometimes it is useful to distinguish between an internal link and an external link, and one way to do that is by placing an icon after the link.

For example, the link to Biztechtonics is an external link.

You can also add icons to links for other purposes, like indicating that a link intiates a download, or displays a PDF file, or allows the user to edit something.


Recommended Content

Subscribe to RSS - Code Snippets