<img>:
- HTML img tag is used to display image on the web page.
- It is an empty tag that contains attributes only.
- “src” attribute is necessary that describes the path of the image.
<! DOCTYPE html> <html> <body> <img src=”logo.jpeg”/> </body> </html> |
Attributes <img> tag:
- alt: This attribute defines an alternate text for the image, if it can’t be displayed.
- width: It is an optional attribute to specify the width of image.
- height: It is used to specify height of image.
<!DOCTYPE html> <html> <body> <img src=”logo.jpeg” height=”180″ width=”300″ alt=”AmeerpetIT Logo”> </body> </html> |
Scrolling Image:
<!doctype html> <html> <body> <marquee> <img src=”logo.jpeg”/> </marquee> </body> </html> |