Here’s a breakdown of the provided HTML snippet, focusing on the image facts:
Overall Structure
The code represents an <figure> element containing an <img> tag. This is a standard way to display images within a webpage, often with associated captions or other content. The figure has classes for layout and styling (_figure_qp4xg_1, layout-component, layout-normal). The img tag has classes for image styling (_image_qp4xg_65,layout-component,layout-normal).
Image Details
* alt="Photo: Nicola Pittam / Nicola Pittam": This provides alternative text for the image, used by screen readers and displayed if the image fails to load.
* decoding="async": This attribute tells the browser to decode the image asynchronously, improving page load performance.
* loading="lazy": This attribute enables lazy loading,meaning the image won’t be loaded untill it’s near the viewport. This also improves initial page load time.
* height="829": The height of the image is set to 829 pixels.
* itemprop="image": This attribute is used for semantic markup, indicating that this is the main image for the content.
* sizes="(min-width: 980px) 980px, 100vw": This attribute helps the browser choose the moast appropriate image size based on the screen width. If the screen is 980px or wider, the image will be displayed at 980px wide. Or else, it will take up 100% of the viewport width.
* src="https://akamai.vgc.no/v2/images/bc918aea-d394-447f-8a38-7af352ba37b5?format=auto&w=40&s=9cafe3a06290d4255030baa077b73f03a0383b03": This is the URL of the initial image being loaded. It’s a very small image (40px wide).
* srcset="...": This is the key to responsive images. It provides a list of different image URLs with corresponding widths. The browser will choose the most appropriate image from this list based on the screen size and resolution. Here’s a breakdown of the srcset values:
* https://akamai.vgc.no/v2/images/bc918aea-d394-447f-8a38-7af352ba37b5?format=auto&w=40&s=9cafe3a06290d4255030baa077b73f03a0383b03 40w (40px wide)
* https://akamai.vgc.no/v2/images/bc918aea-d394-447f-8a38-7af352ba37b5?format=auto&w=80&s=4218d0977cf6523249286ff594937b2438f53080 80w (80px wide)
* `https://akamai.vgc.no/v2/images/bc918aea-d394-447f-8a38-7
