The image element <img> is used to insert an image into your document. It is very important to understand that images are not technically "part" of the web page file, they are separate files which are inserted into the page when it is viewed by a browser. To use the image element <img>, the image you specify in the
src
attribute needs to be available on a web server. This could be your own web server or another web server such as PhotoBucket.Listed below are the most common attributes you can use for the image element <img>:
- alt - provides a description of the image and is displayed whenever a web browser cannot handle the image.
- border - sets the width in pixels (px) of the image's border.
- class - provides the class or classes of the heading. This attribute is used to identify the name of the style class or classes to be used for rendering.
- id - provides a unique name for the heading.
- height - sets the height in pixels (px) of the element.
- name - provides a name for the element.
- src - provides a Uniform Resource Locator (URL) for the inline frame's document.
- style - provides a cascading style sheet (CSS) properties to the element.
- title - privides a text title for the heading. Most web browser displays the value of the title as "tooltip".
- width - sets the width in pixels (px) of the element.
Here's an example on how to use the image element <img>:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=utf-8" />
<mate name="keywords" content="blog, web development" />
<title>the IMAGE element</title>
</head>
<body>
<h1>
the IMAGE element
</h1>
<img src="faq_img.png" width="322" height="219" alt="FAQ Image">
</body>
</html>
0 comments:
Post a Comment