In this tutorial you will learn about the HTML Images and its application with practical example.
Images plays a very important role in presenting the information.We can also embed the images into the HTML Document, this can be accomplished using <img> tag.
Syntax:
1 |
<img src="image URL" alt="some_text" attr_name="attr_value"...more attributes /> |
Image Tag Attributes
Attribute | Value |
---|---|
width | This optional attribute specifies the width of the image element. |
height | This optional attribute specifies the height of the image element. |
border | This attribute specifies the border around the image. |
src | This attribute specifies the path to the image. It can be either an absolute path, or a relative path, it is required attribute |
alt | This attribute specifies the alternative text to be displayed when the browser can’t find or render the image. |
align | This attribute specifies the horizontal alignment of the image. Example -left, right or center. |
Example:
1 |
<img src="w3schoollogo.png" alt="W3school.in" /> |
Output: