...

/

HTML5 Image Tag

HTML5 Image Tag

In this lesson, we will go over some commonly asked questions on List Tags in HTML.

Test your understanding on image tag in HTML5

An MCQ assessment and code analysis:

1

Which of the following statements regarding the <img> tag is correct? Select all that apply.

A)

The <img> tag is used to embed an image in an HTML page.

B)

Images are linked to web pages. The <img> tag creates a holding space for the referenced image.

C)

src - Specifies the path to the image.

D)

alt - Specifies an alternate text for the image if the actual title of the image cannot be displayed.

E)

alt - Specifies an alternate text for the image, if the image for some reason cannot be displayed.

Question 1 of 120 attempted

Coding scenario:

Resolution switching and responsive images

In the case where we open a web page on a mobile phone, there’s no need to embed large-sized images on our website. Conversely, when viewed bigger than its original height, a small raster image tends to appear grainy (a raster image is a fixed number of pixels wide and a fixed number of pixels thick).

In comparison, displaying a large picture on a screen with a considerably smaller size for which it was intended will cause wastage of bandwidth. Even so, certain systems have high-resolution displays that need larger images for the displayed result to appear well.

To solve these concerns, the img tag introduces two attributes: srcset and sizes, to provide additional source images ...