How To Use The HTML <img> Tag
Syntax
Syntax of HTML <img im> tag
- HTML image tag is <img> element denoted
- HTML <img> tag use purpose embed image in your web page.
- HTML Image tag write <img src ="...">
- HTML Image tag URL/path. to the image
- HTML Image tag self -closing tag.
- HTML Image tag is not closing tag,(only opening tag).
- HTML browser to display image form file use .png, .jpg, .gif, ... etc
How To Use The HTML <img> Tag
Example
How To Use The HTML <img> Tag
Explain Program
Step 1]
<!DOCTYPE html>
This declare the document type.
browser that the document is written in html
Step 2 ]
<html>.... . </html>
html is the root element of the html page.
Every thing inside it is part of the webpage.
Step 3]
<head> section
head section contains metadata about page. not visible on the page itself.
<title> tag title section set the title of the page shows the browser tab.
Step 4]
<body>
< body> tag contains all the content visible to webpage.
<body> tag contains all the visible content of the page.
inside <body> show the browser screen.
Step 5]
<h1> Tag heading tag use for main title on webpage .
Step 6]
<img> :- Use to display image on webpage.
<src=" . . ."> : - Picture URL Source of the image .
width="... " :- image width to 200 pixel.
height ="..." :- image height to 200 pixel.
Step 7]
