Can I Wrap?

Can you nest an HTML element inside another?

Take the HTML Nesting Quiz
< >
inside
< >

Popular checks

Content categories

Every HTML element belongs to zero or more content categories that define where it can appear and what it can contain. Each element's content model specifies which categories it accepts as children. Learn more on MDN →

The broadest category. Most elements that can appear inside <body> are flow content. This includes block-level elements, inline elements, and everything in between.

Block
Inline
Inline replaced
Table
Hidden

Text and inline-level elements. A subset of flow content. Elements like <p>, <h1>, and <button> only accept phrasing content as children.

Block
Inline
Inline replaced
Hidden

Elements designed for user interaction. An important rule: interactive content cannot be nested inside other interactive content (e.g. no <button> inside <a>).

Block
Inline
Inline replaced

Elements that import external resources or insert content from another markup language into the document.

Inline replaced

Elements that define the title of a section. These are restricted from appearing inside elements like <address> or <dt>.

Block

Elements that create a section in the document outline, defining the scope of <header> and <footer> elements.

Block