Images - HTML

One of the great innovations the World Wide Web and HTTP brought to the Internet was the ability to serve up multimedia to clients. The precursors to full-motion video and CD quality sound were graphical images, in the Web-friendly Graphics Interchange Format (GIF) and Joint Photographic Experts Group (JPEG) formats.

You can include images in HTML documents by using the image tag (<img>). The image tag includes a link to the image file as well as pertinent information used to display the image (for example, the image size). A typical image tag resembles the following:

<img src=“/images/tmoore.jpg” alt=“A picture of Terri” width=“100” height=“200”>

The preceding example would result in the image tmoore.jpg being displayed at the location in the document where the tag appears. In this case, the image is in the images directory of the current server and will be displayed without a border, 100 pixels wide by 200 pixels high. The alt attribute is used to provide a textual equivalent for browsers that cannot display graphics (or whose users have configured them not to).

Images can also be used as navigation aids—allowing the user to click certain parts of an image to perform an action, display another document, and so on. For example, a map of the United States could be used to help a user select their state—clicking a state would bring up the applicable page for that state. Navigational images are commonly referred to as image maps and require a separate map of coordinates and geometric shapes to define the clickable areas.

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd Protection Status

HTML Topics