“This is the sixth day of my participation in the August More Text Challenge. For details, see: August More Text Challenge.”

Image label<img/>

The tag is used to display the images in an HTML page, making the page “graphic”.

The tag has two required attributes: SRC and Alt.

Note: Technically, images are not inserted into HTML pages, but are linked to them.The tag is used to create a placeholder for the referenced image.

We can add a link to an image to another document by nesting the tag within the tag.

Now let’s look at its properties.

Attribute Value Description align top bottom middle left right HTML5 Unsupported. HTML 4.01 is deprecated. Specifies how images are arranged according to the surrounding text. Alt text specifies the alternative text for the image. Border Pixels HTML5 is not supported. HTML 4.01 is deprecated. Specifies the border around the image. CrossoriginNew Anonymous use-Credentials Set the cross-domain attribute height Pixels to specify the height of the image. Hspace Pixels HTML5 is not supported. HTML 4.01 is deprecated. Specifies the Spaces on the left and right sides of the image. Ismap ISMAP specifies an image as a server-side image map. Longdesc URL not supported by HTML5. HTML 4.01 is deprecated. Points to the URL that contains the long image description document. SRC URL Specifies the URL to display the image. Usemap #mapname defines an image as a client-side image map. Vspace Pixels HTML5 is not supported. HTML 4.01 is deprecated. Specifies the space at the top and bottom of the image. Width Pixels Specifies the width of the image.Copy the code

<img Alt =" star "SRC ="img/30.jpg" width="200" height="200"/>

For the tag, the SRC attribute is the most important, followed by the height and width attributes.

For the SRC attribute

The possible values: absolute URL - points to another web site (such as SRC = "http://www.example.com/image.gif") - a relative URL - pointing to a file within the site (such as SRC = "image. GIF")Copy the code

The units for the height and width attributes can be not only px, but also percentages, which are relative to their parent tags.

When using percentages, the size of the image changes with the size of the browser window. When using px, the size of the image does not change with the size of the browser window.