Adding icons to links

Adding icons to links is one of the simplest ways to communicate the link type to your site visitor. You might have different icons for different sections of your site, or you might want to provide some downloadable files to your site visitors—for example, a PDF or e-book that you've written, the slides for a presentation you gave, or some stock icons or photography that you've created. Adding icons to these types of links can help give a visual clue to your site visitors so they know what to expect when they click on the link. Let's take a look at how we can add appropriate icons to different link types with jQuery.

Here's an example of what our page will look like after we've added icons to our links:

Get jQuery for Designers Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.