In this tutorial, we are going to show you how to add an image in HTML website.
<img> tag is used to display image in the document. It has no ending tag. It is an empty tag.The attribute of <img> tag is as follows.
Now. lets insert image in the html document.
<html>
<head>
<title>
image tag
</title>
</head>
<body>
<img src="C:\Users\Public\Pictures\Sample Pictures\Lighthouse.jpg" width=200 height=200>
</body>
</html>
Output is
<img> tag is used to display image in the document. It has no ending tag. It is an empty tag.The attribute of <img> tag is as follows.
Attributes of <img> tag
Attributes
|
Value
|
Description
|
Src
|
Path.
|
The path of the image.
|
Width
|
Value in pixels or %.
|
Sets the width of the image.
|
Height
|
Value in pixels or %.
|
Sets the height of the image.
|
Alt
|
Text.
|
To display the alternate text.
|
Hspace
|
Value in pixels.
|
To set the horizontal spacing in pixels or percentage.
|
Vspace
|
Value in pixels.
|
To set the vertical spacing in pixels or percentage.
|
Align
|
Left
Right
Top
Middle
Bottom
Absbottom (absolute bottom).
|
To set the alignment of the image.
|
Border
|
Value in pixels or percentage.
|
Specifies the width of the images border.
|
Now. lets insert image in the html document.
Add Image In HTML Web Page
<html>
<head>
<title>
image tag
</title>
</head>
<body>
<img src="C:\Users\Public\Pictures\Sample Pictures\Lighthouse.jpg" width=200 height=200>
</body>
</html>
Output is
In the above example you have seen image with attribute width and height.
Learn : How to add html frames
Comments
Post a Comment