scriptygoddess

03 Aug, 2011

HTML Basics (linking an image)

Posted by: Jennifer In: Basics|HTML

I had a client ask me how to do the HTML to link an image to an email address. Figured I'd post my response here in case it can help others. It's basic stuff, but useful to some I guess! :)

This is how you do the IMAGE HTML:

<img src="PATH-TO-IMAGE-FILE-HERE" />

(so let's say your image is here: http://www.flickr.com/photos/cairnrhana/4706506245/
to put that image into HTML – you'd do this:

<img src="http://www.flickr.com/photos/cairnrhana/4706506245/" />

To do a LINK – you need to wrap something with an anchor tag…

<a href="LINK-TO-SOMEWHERE">STUFF HERE</a>

So let's say you wanted to link some text to http://somewhereovertherainbow.com

<a href="http://somewhereovertherainbow.com/">TEXT HERE</a>

To link the IMAGE to that URL you'd take your "text here" out and put in the HTML for your image:

<a href="http://somewhereovertherainbow.com/"><img src="http://www.flickr.com/photos/cairnrhana/4706506245/" /></a>

To do an EMAIL link – instead of a URL you add "mailto:" in the anchor tag's href – then follow that up with the email address you want to link to:

<a href="mailto:dorothy@overtherainbow.com"><img src="http://www.flickr.com/photos/cairnrhana/4706506245/" /></a>

1 Response to "HTML Basics (linking an image)"

1 | Toronto Chiropractic

October 21st, 2011 at 4:28 pm

Avatar

This is a simple/basic html linking but there are a lot of people who doesn't have a clue on how to do it. So thanks for posting this one up.

Featured Sponsors

Genesis Framework for WordPress

Advertise Here


  • Scott: Just moved changed the site URL as WP's installed in a subfolder. Cookie clearance worked for me. Thanks!
  • Stephen Lareau: Hi great blog thanks. Just thought I would add that it helps to put target = like this:1-800-555-1212 and
  • Cord Blomquist: Jennifer, you may want to check out tp2wp.com, a new service my company just launched that converts TypePad and Movable Type export files into WordPre

About


Advertisements