HTML Image
The HTML image tag is an empty tag means it does not have a closing tag. It has the following required attributes namely src
& alt
. The src
attribute is used to provide a path of the existing image while the alt
attribute shows a message when the image path is not correct or missing.
General syntax for HTML image
element:
Statement
<img src="URL of the image" alt="Specify about image">
Statement
<img src="https://picsum.photos/200/300" alt="This is an external image">
This is a paragraph having an image tag also. The image can be aligned on the left side by using the CSS cascade style sheet rule. Images width and height can also adjust by a CSS rule.