How To Use The HTML <img> Tag
This Blog You Will Learn
ஃ What is the <imag> tag?
ஃ Syntax of HTML <img im> tag
ஃ How to Write HTML TAG
ஃ How src Works
ஃ Important Rules for alt
ஃ Explain Program
ஃ Output
What is the <imag> tag?
✅creates a placeholder than picture will appear,
✅ HTML <img> tag is a self colsing tag.
✅<img> tag doesn't separate closing tag.
✅HTML Image tag make webpage more attractive and engaging.
✅You creating a business site, personal blog,portfolio website,education
Syntax of HTML <img im> tag
How to Write HTML 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 src Works
ஃ src attribute source use HTML to tell browser.
ஃ src attribute provides path or URL image file. ஃ finds the image at that location.
ஃ Relative path points to image inside your project folder.
ஃ src attribute provides path or URL image file.
How alt Works- alt attribute (alternative text)
- alt use with <img> tag to describe image information.
- alt use with <img> tag help use and browsers understand what image is about when
- image cannot be display to browser this time refer to use and browser .
Important Rules for alt- Always include alt
- Describe the image clearly
- keep is information meaningful
- Do not write image of picture.
- Leave empty (alt=" " ) for decorative images
How To Use The HTML <img> Tag
- alt attribute (alternative text)
- alt use with <img> tag to describe image information.
- alt use with <img> tag help use and browsers understand what image is about when
- image cannot be display to browser this time refer to use and browser .
- Always include alt
- Describe the image clearly
- keep is information meaningful
- Do not write image of picture.
- Leave empty (alt=" " ) for decorative images
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]
closing the Tag
