Websites‎ > ‎Google Sites How-tos‎ > ‎

Google Sites - Making an Image a Link

posted 16 Feb 2009 05:22 by Stephen Hind   [ updated 11 Apr 2014 08:06 by Sam Smullen ]
Many Google Sites users want to know how to make an image a link and Google have just updated Google Sites (2010-08-02) to make this even easier to remove and edit the link on an image, so please follow these instructions to find out how.

Instructions

Remove Default Automatic Link to Image

  1. When you add an image to the page Google Sites automatically makes the image a link to the image itself, so select (or click) the image
  2. You will see the Image Option dialogue box appear (it contains both the link information, alignment, size and wrap options): use the upper Remove link - this removes the automatically added link to the image itself.

Make an Image a Link

  1. Use the Insert  menu and Image to add your image to the page
  2. Select (or click) the image and you will see the Image Option dialogue box appear: use the Change link
  3. Either choose the page you wish to link to or go to the Web address tab and add the URL you want to link to
  4. Use the OK button and your image will now link to the page or web address you chose.

Remove a Link from an Image

  1. Select (or click) the image and you will see the Image Option dialogue box appear (it contains both the link information, alignment, size and wrap options)
  2. Use the upper Remove link and the image will no longer link to anything.
If you want to make an image already on the page a link the easiest way to do this is to remove the image and re-insert it, so you can follow the steps above in Make an Image a Link.

Code Instructions

Only use these instructions if you want to hand code the link in HTML

  1. Use the Insert  menu and Image to add your image to the page
  2. Once added to the page Google Sites automatically makes the image a link to the image itself, so you need to alter this link to point to the website you want: to do this you need to use the HTML button to edit the HTML around the image.
  3. Once in the HTML find the
    <a href="..."> </a>

    around the image and change the contents of the
    href="..."

    to the web address you want.
  4. If you want to add an alternative text tag to your image, so if the image does not load or someone with visual impairments using a screen reader can sill get the information the images conveys add
    alt="Alternative Text"
    to inside the
    <img >
    tag.
    Note: do not try to describe the image, but what it's there for, e.g. if it's a link to Google Sites then make the alternative text "Google Sites".
  5. If you want to give more information of where the image link will take you then add a title attribute to the link: to do this add
    title="descriptive text"
    to the
    <a href="...">
  6. If you want the link to open in a new window then add a target attribute to the link: to do this add
    target="_blank"

    to the
    <a href="...">

See the examples on the right to see specifically how it's done done.


Option Boxes

Image Option Box

Google Sites - Image Options Box

Code Examples

Inserted Image


  1. The image above when clicked will take you to the image itself and the HTML code for it is:
    <a href="http://www.google.com/a/help/intl/en/images/sites_35.gif" imageanchor="1"><img src="http://www.google.com/a/help/intl/en/images/sites_35.gif" border="0"></a>
  2. Change the
    <a href="http://www.google.com/a/help/intl/en/images/sites_35.gif" imageanchor="1">
    to
    <a href="http://sites.google.com">
    and the image now becomes a link to Google Sites - see below

Linked Image


  1. To add the title to the link and alternative text to the image you should produce something like:
    <a href="http://sites.google.com" title="Google Sites - free websites and wikis"><img src="http://www.google.com/a/help/intl/en/images/sites_35.gif" border="0" alt="Google Sites"></a>
    When you put your mouseover the image below see what happens.

Linked Image with Title

Google Sites
  1. To remove the link from the image you should remove the highlighted code:
    <a href="http://www.google.com/a/help/intl/en/images/sites_35.gif" imageanchor="1"><img src="http://www.google.com/a/help/intl/en/images/sites_35.gif" border="0"></a>
    So you're left with:
    <img src="http://www.google.com/a/help/intl/en/images/sites_35.gif" border="0">
    See below for just the image:

Just the image, no link

Google Sites