HTML·Beginner·Conceptual·1 min read
What determines which source in a picture element the browser uses?
Short interview answer
The browser evaluates source elements in document order and uses the first one whose media condition matches and whose type, if present, it supports; if none match, it falls back to the img element, which is required and also supplies the alt text used in every case.
Key takeaway
Explain the underlying mental model clearly, then support it with a concrete example and its trade-offs.