📡 You're offline — showing cached content
New version available!
Quick Access
Tutorials HTML Fundamentals HTML Interview Prep

HTML Interview Prep

5 min read Quiz at the end
HTML interview topics: DOCTYPE, defer vs async scripts, block vs inline elements, semantic vs non-semantic HTML, void elements, ARIA roles, the difference between class and id, and the viewport meta tag purpose.

HTML Interview Topics

  • DOCTYPE — tells browser to use standards mode
  • defer vs async — defer preserves order; async doesn't
  • semantic vs non-semantic — header vs div
  • void elements — img, br, hr, input (no closing tag)
  • accessibility — ARIA, alt text, keyboard navigation
  • block vs inline — div vs span
  • meta viewport — essential for responsive design
Topic Quiz · 5 questions

Test your understanding before moving on

1. What is the purpose of DOCTYPE?
💡 <!DOCTYPE html> activates standards mode rendering in all browsers.
2. Void elements in HTML are:
💡 Void elements like <img>, <br>, <input> cannot have children and need no closing tag.
3. The viewport meta tag is important for:
💡 <meta name="viewport"> enables proper scaling on mobile devices.
4. defer vs async — which preserves script order?
💡 defer executes scripts in order after HTML parsing; async executes immediately when loaded.
5. What is the difference between id and class?
💡 id must be unique per page; class can be applied to multiple elements.