Repair the overlapping tags

The tags in this page overlap. It may look fine, but the browser is guessing.

What to build

The same sentence, correctly nested.

Requirements

  • One p element holding the whole sentence Learning HTML is fun.
  • The word HTML inside a strong element, inside the p.
  • The word fun inside an em element, inside the p.

Constraints

Do not add or remove any words.

Example

Elements close in reverse order: <p><em>word</em></p>.

Why it works

Each element must sit completely inside its parent, so the browser builds exactly the tree you meant.

Hints

Hint 1

Find each pair of tags. The tag opened last has to close first.

Hint 2

Check that the closing tags appear in the reverse order of the opening ones.

Solution

Show one correct solution (try it yourself first)
<p>Learning <strong>HTML</strong> is <em>fun</em></p>

Lesson: What HTML is and how a browser reads it →