Presentation is loading. Please wait.

Presentation is loading. Please wait.

HTML Images. The Image Tag and the Src Attribute  In HTML, images are defined with the tag.  In HTML, images are defined with the tag.  The tag is.

Similar presentations


Presentation on theme: "HTML Images. The Image Tag and the Src Attribute  In HTML, images are defined with the tag.  In HTML, images are defined with the tag.  The tag is."— Presentation transcript:

1 HTML Images

2 The Image Tag and the Src Attribute  In HTML, images are defined with the tag.  In HTML, images are defined with the tag.  The tag is empty, which means that it contains attributes only and it has no closing tag.  To display an image on a page, you need to use the src attribute. Src stands for "source". The value of the src attribute is the URL of the image you want to display on your page.

3 The syntax of defining an image:  The URL points to the location where the image is stored. An image named "boat.gif" located in the directory "images" on "www.disney.com" has the URL: http://www.disney.com/images/boat.gif.  The browser puts the image where the image tag occurs in the document. If you put an image tag between two paragraphs, the browser shows the first paragraph, then the image, and then the second paragraph.

4 The Alt Attribute  The alt attribute is used to define an "alternate text" for an image. The value of the alt attribute is an author- defined text:    The "alt" attribute tells the reader what he or she is missing on a page if the browser can't load images. The browser will then display the alternate text instead of the image.  It is a good practice to include the "alt" attribute for each image on a page, to improve the display and usefulness of your document for people who have text- only browsers.

5 Image Tags TagDescription Defines an image Defines an image map Defines an area inside an image map

6 Inserting an Image

An image:

A moving image:

Note that the syntax of inserting a moving image is no different from that of a non-moving image.


7 Inserting Images from different locations

An image from another folder:

An image from Disney:


8 Background Image Look: A background image! Look: A background image! Both gif and jpg files can be used as HTML Both gif and jpg files can be used as HTMLbackgrounds.

If the image is smaller than the page, the If the image is smaller than the page, the image will repeat itself. image will repeat itself.

9 Adjust images to different sizes

You can make a picture larger or smaller changing the values in the "height" and "width" attributes of the img tag.


10 Make a hyperlink of an image

You can also use an image as a link:


11 Create an image map

Click on one of the planets to watch it closer:

Sun Mercury coords="124,58,8"alt="Venus"href="venus.htm">

Note: We use both an id and a name attribute in the map tag Note: We use both an id and a name attribute in the map tag because some versions of Netscape don't understand the id attribute. because some versions of Netscape don't understand the id attribute.

12 Turn an image into an image map

Move the mouse over the image, and look at the status bar to see how the coordinates change.



Download ppt "HTML Images. The Image Tag and the Src Attribute  In HTML, images are defined with the tag.  In HTML, images are defined with the tag.  The tag is."

Similar presentations


Ads by Google