Hyperlinking an Image in HTML

As we learned previously, adding a link to your webpage is easy:

<a href=’http://thisismyurl.com’>My Website</a>

And adding an image to your webpage is equally simple:

<img src=’http://thisismyurl.com/files/2010/10/wp-super-cache-150×150.jpg’ alt=’WP Super Cache Icon’>

Combining the two tags to create a linkable image is almost as easy. We simply wrap the <a> tag around the <img> but don’t forget the <a> needs both an opening and a closing!

<a href=’http://thisismyurl.com’><img src=’http://thisismyurl.com/files/2010/10/wp-super-cache-150×150.jpg’ alt=’WP Super Cache Icon’></a>

You can follow the rest of this tutorials I’ve released. They include:

If you’d like to be notified when I post a new article, you can signup for my RSS feed or follow me on Twitter.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>