Attributes of <img> TagAn attribute is an extra piece of information associated with a tag that provides further details about the tag.Following are the various attributes of <img> tag:The src Attribute: The src (source) attribute takes URL (Universal Resource Locator) of an image file as value, which points to the direct location of an image to be displayed. The image that you specify in your <img> tag should be in your computer otherwise the image will not be displayed and in place of image a cross mark in a box 0 will appear.The alt Attribute: This attribute of <img> tag is used to provide alternate text when an image on a Web page cannot be displayed. The alternative text is the text associated with an image that serves the same purpose and conveys the same essential message. As per HTML standard, alt attribute is optional but is highly recommended.The align Attribute: This attribute is used to set the position of an image in a Web page according to the user’s requirements. In HTML, images appear inline with a single line of the text. But, HTML standard does not define a default alignment for the images with respect to other text and images in the same line. There are some values of image alignment attribute as follows:1. Top Alignment2. Middle Alignment3. Bottom Alignment4. Left Alignment5. Right AlignmentThe width and height Attributes: When an image is added to a Web page, it is not mandatory to specify width and height of the image. At the time of loading an image, a box will appear on the place where the image will be loaded.The border Attribute: You can set the border of an image that you want to use in your Web page. The border attribute of the <img> tag specifies the width of the border around an image. By default, an image has no border in HTML.