Interview Question

What is decoding async?

Decoding hints how image decoding should be scheduled.

💡 Concept ✅ Quick Revision 🌐 HTML

Answer

The `decoding` attribute provides a hint for how the browser should decode an image; `async` allows decoding without delaying other presentation work. β€’ It is written inside an element’s opening tag. β€’ The HTML Standard limits which elements may use it and which values are valid. β€’ Browsers apply the attribute when they process the element or the resource it controls.

💡 Simple Example

<img src="/images/photo.jpg" decoding="async" alt="A mountain beside a lake" width="640" height="360">

⚡ Quick Revision

Decoding hints how image decoding should be scheduled.