- Description:  <img> refer to image tag and src is attribute which loads image specified in given path.
- Example syntax: <img src=”myimage.jpg”width=”500″ height=”600″>
1 2 3 4 5 6 7 8 9 |
<!DOCTYPEÂ html> <html> <head> <title>Title</title> </head> <body> <img src="https://www.example.com/images/sunset.jpg" alt="A beautiful sunset over the ocean" width="600" height="400" class="sunset-img"> </body> </html> |
- The “alt” attribute provides a text description of the image, which is displayed if the image cannot be loaded .
- width & height defines the size of the image need to be shown.