menu_book Course Curriculum (HTML) expand_more
Srcset width descriptors
Learn Srcset width descriptors in HTML through one focused, topic-specific example.
Srcset width descriptors is a concrete HTML behavior inside Images and Media. This lesson focuses on the actual markup contract: what the browser parses, what users and assistive technology receive, and which attributes change that behavior.
Read the example as document structure rather than decoration. Identify the element or attribute that carries the meaning, then check the edge case called out below. Valid-looking markup is not automatically semantic markup.
Topic-specific example
<img src="hero-640.jpg" srcset="hero-640.jpg 640w, hero-1280.jpg 1280w" sizes="(max-width: 700px) 100vw, 700px" alt="Team collaborating at a whiteboard">
Use Srcset width descriptors for its semantic purpose rather than because its default browser styling happens to look convenient.