SILS iSchool

26 Sep 2018

Value Added | daily

Class Schedule

Basics | sessions 01-05

22 AUG | intro
27 AUG | clients
29 AUG | servers
05 Sep | networks
10 Sep | basics lab

Web Development | sessions 06-11

12 Sep | structural layer
17 Sep | presentational layer
19 Sep | working with layers |
24 Sep | behavior layer |

26 Sep | images & design | design thoughts | accessible design | next session

01 Oct | website lab

Document Markup | sessions 12-14

03 Oct | object layers
08 Oct | tools that read markup
10 Oct | document markup lab

Spreadsheets | sessions 15-19

15 Oct | spreadsheets
17 Oct | formulas & functions
22 Oct | data display
 18 Oct | Fall Break 
24 Oct | database tools
29 Oct | spreadsheets lab

Relational Database | sessions 20-26

31 Oct | relational databases
05 Nov | tables
07 Nov | relationships
12 Nov | input & output
14 Nov | SQL
19 Nov | complex queries
26 Nov | databases lab
 21 Nov | Thanksgiving 

Presentation | sessions 27-30

28 Nov | presentation design
03 Dec | presentation delivery
05 Dec | presentation lab
12 Dec | 0800-1100 | final in class presentation

Images can add a lot to your web pages. Consider using individual images as hyperlinks.
Consider the utility of multiple hyperlinks on an images map as a navigational tool.


tag attribute value

Working with images

Image tags

You put images in a web page using the img element. For example, if you include this image tag in your page
< img src="images/GEB.png" />

[Goedel Escher Bach]

then the image displayed on this page will be displayed on your page when you load the page. (But only if you have the image stored at the same relative file location from the file location where this particular web page is stored - in a directory named "images" that is three levels away in the file hierarchy from this page)

In the general case, the img element can have a number of attributes though the above example only has a single one, src. In this case, the src attribute is required -- it doesn't make sense to have an img tag without specifying which image.

The img tag can take any or all of the following as attributes:

  • alt Alternate text to be displayed if image is not loaded
  • width Width of image in pixels
  • height Height of image in pixels

So the img tag (with an absolute, not relative, location this time)

    alt="[Goedel Escher Bach]"
    src="" />


Display the specified image
use [Goedel Escher Bach] as the alternate text if the image is not or cannot be displayed.
display it with a width of 301 pixels
display it with a height of 349 pixels
Find the source of the image at the location specified after the = sign and self-close the tag

But why does the image on lines 227-233 of this page display in the center of the space?

It does so because the HTML tags that encompass it refer back to a CSS element that tells the IMAGE object how to display. In particular the encompassing HTML element is a special kind of span. Note how, on line 229 in the code for this page, one sees the tag


which refers to the instructions on line 61 on the stylesheet where the special image class named "center" is defined

.center { display: block; text-align: center; margin: 20px auto; }

So an image tag which includes the class attribute named the value "center" will then display in the center of the space.

back to top

Images as hyperlinks

To make an image into a hyperlink, embed the img tag inside the hypertext anchor

<a href="">
        alt="[Goedel Escher Bach] "
        src="" />

Now when you click on the image it will take you to the UNC homepage.

back to top

Image Maps

Image maps are "clickable images". They allow you to specify which URL should be accessed when a user clicks on a part of an image. For example, if you have a state map and want to bring up information about selected counties when a user clicks on the shape of the county, then you can do so by defining a geometric shape around a county and associating the coordinates of that shape with a URL of your choosing - in this case, a county information page. This is a very powerful tool and gives you a lot of flexibility in how you design your pages. It's a step towards dynamic-content as well.

There are two dimensions to image map creation.

  1. First, image maps can be client-side or server-side
    • A client-side image map contains all of the shape information and associated URLs in an HTML document, usually the same document that contains the image. They run more quickly because the client has all the information it needs to work.
    • On the other hand, a server-side map contains all of this information on the server in a place completely separate from the file containing the image. The terms client-side and server-side simply refer to where the "click" coordinates are interpreted and translated into a corresponding URL - on the client or on the server. Server-side image maps require you to do the creation work on the server.
  2. The second, more practical dimension of image map creation, is how to actually create one, in this case a client-side image map.
    • You can create a map by hand using any of a number of free applications, a program like DreamWeaver or Photoshop to determine the shape coordinates, or you can use a program specifically designed to do image map creation.
    • ITS has contracted with Adobe to make Creative Cloud (which includes both Dreamweaver and Photoshop) available to all students. Go to the Adobe Creative Cloud page and download the programs you need. SILS has links to relevant tutorials so you can get the most out of programs like Dreamweaver.

back to top

An Example

Here is a simple example of the HTML code for a client-side image map. Looking at the code, we see the instructions shown below on this page.

<h2>North Carolina
<map name=" FPMap0">
<area href="counties/Brunswick.htm" shape="circle" coords="375, 189, 18">
<area href="counties/Columbus.htm" shape="circle" coords="348, 175, 18">
< area href="counties/NewHanover.htm" shape="circle" coords="399, 177, 15">

[we skipped many lines of code here]

< area href="counties/Jones.htm" shape="polygon" coords="408, 123, 417, 104, 440, 112, 440, 137, 412, 121">
     alt="map of North Carolina's 100 counties" />

Components of the image map.

  • The usemap attribute of the img element says "this is a client-side image map".
  • The map shapes and coordinates are in a map element called "#FPMap0".
  • The map element shows two separate shapes (circle and polygon), each of which refers to a different file, designated by its relative location in the file structure.

back to top

You can use some editors to create image maps or online tools such as

back to top