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.

Example

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

Tags: 

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.

Tags: 

Recommended Content

Subscribe to RSS - Code Snippets