ProCoreInterview prep

HTML Errors & Edge Cases

What the parser does when you get it wrong: unclosed tags, void elements written as containers, blocks inside paragraphs, and text foster-parented out of a table. Every item shows the tree you actually got rather than the one you wrote.

Questions90
Topics10
Answering time68 minutes
At five a day18 days
LevelCore

Who it is for

Writes the happy path well.

The behaviour people get wrong after they are already productive in the language.

You will get the most out of it if you have written HTML recently enough to read it without effort, and have been surprised by it at least once. If you are picking the language up for the first time, start with HTML Essentials and come back to this one.

It is also built for interview preparation: the questions are the ones that get asked because they separate people who have read the documentation from people who have hit the behaviour in production.

How long it takes

90 graded questions at roughly 45 seconds each is about 68 minutes of answering in total.

At the default five questions a day, and because the session mixes in your other courses, expect around 18 days — call it 3 weeks — to see everything once, plus a few weeks of thinning reviews after that before it is all mastered.

A question is mastered on the third correct answer, once the gap between reviews has grown past a week — so a course cannot be finished in a weekend however long you sit with it.

Question mix

  • 60 multiple choice
  • 10 concept cards
  • 10 predict the output
  • 10 put it in order
  • 10 matching questions

Syllabus

What you will be asked about

  1. 01

    Tags You Forgot to Close

    Work out where an unclosed element ends, and what it takes with it on the way.

  2. 02

    End Tags That Were Never Required

    Tell a legally omitted end tag apart from one you actually forgot.

  3. 03

    Void Elements Written as Containers

    Predict what an end tag on a void element does, including the one that adds an element.

  4. 04

    Foster Parenting Out of Tables

    Predict where content that does not belong in a table ends up, and what gets dropped entirely.

  5. 05

    Misnested Tags & the Adoption Agency

    Predict the tree when formatting elements overlap instead of nesting.

  6. 06

    Blocks Inside a Paragraph

    Explain why a paragraph ends early, and where the empty paragraphs come from.

  7. 07

    Duplicate and Broken ids

    Predict which element wins when an id is not unique, and what quietly breaks.

  8. 08

    Interactive Inside Interactive

    Spot the nesting the parser repairs, the nesting it leaves alone, and why the second is worse.

  9. 09

    Stray Tags, Text & Attributes

    Say what happens to a token that arrives where nothing can accept it.

  10. 10

    Quirks Mode & What Errors Cost

    Say what the doctype switches on, and which parse errors reach a user rather than a validator.

8 more topics, and all 90 questions

HTML Errors & Edge Cases is a Pro course. One subscription opens it and every other course in the catalogue, including the ones still being written.

See pricing Find a free course

A question from this course

Tags You Forgot to Close

Where does the second div end up?

<div>
  <b>Note
  <div>Next section</div>
</div>
  • AAs a sibling of the b, which is closed by the block-level start tag
  • BOutside the outer div, foster parented like table content
  • CNowhere: the unbalanced tags make the parser drop the section
  • DInside the b element, because nothing closed it first
Show the answer

D Inside the b element, because nothing closed it first

It feels as though a block-level element must terminate an inline one - that is how the two behave in CSS. The parser has no such rule for b: it stays on the stack, so the whole next section becomes its descendant and inherits bold. The outer </div> is what finally pops it, one element later than you meant.

The rest of the track

HTML at every depth

Start HTML Errors & Edge Cases
in tomorrow’s session.

Enrol and this course joins your daily five, mixed in with everything else you are studying — 90 questions spread over about 18 days rather than dropped on you at once.

Browse the catalogue