The HTML Image
HTML <img> tag is defined to exhibit an image on the web page. This tag is an empty tag that covers attributes only. In HTML image element closing tags are not used.
HTML Image element adds extra beauty to the webpages and explained many complex concepts in simple terms. This HTML tutorial will help you to learn “how to use <img> tag?”
HTML Image tag Attributes
There are two main attributes, which we used with tag:
- src – Describe the path to the image
- alt – Describe an alternate text for the image
HTML Image Syntax
<img src=”url” alt=”some_text” height=”px” width=”px”>
Let’s see below some examples of HTML Image:
Example
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> HTML Image Tag </title> </head> <body> <p>The given example define that an image tag</p> <img src="malware-removal.png" alt="malware" width="400" height="250"> </body> </html>
Output