Block Element Examples
Block elements form the structural foundation of HTML documents.Valid Block Nesting
Div containing Paragraph
Div containing Paragraph
Validation: Use case: Standard content wrapper structure
<div> can contain <p>Result: ✓ AllowedExplanation: The <div> tag is a block element and can contain block or inline elements like <p>.Section containing Headers
Section containing Headers
Validation: Use case: Semantic document structure
<section> can contain <h1>Result: ✓ AllowedExplanation: The <section> tag is a block element and can contain block or inline elements like <h1>.Article with Complex Structure
Article with Complex Structure
Validation: Use case: Blog posts, news articles, documentation pages
<article> can contain <header>, <section>, <footer>Result: ✓ AllowedExplanation: Block elements can contain other block elements for nested structures.Invalid Block Nesting
Paragraph containing Div
Paragraph containing Div
Validation: Why it fails:
<p> cannot contain <div>Result: ✗ Not allowedExplanation: Paragraphs can only contain inline elements according to specific HTML5 rules.<p> has specific rules limiting it to inline content only.Span containing Div
Span containing Div
Validation: Why it fails: Inline elements cannot contain block elements.
<span> cannot contain <div>Result: ✗ Not allowedExplanation: The <span> tag is an inline element and cannot contain block elements like <div> according to HTML5 standards.Interactive Element Examples
Interactive elements like links, buttons, and labels have special nesting restrictions.Valid Interactive Nesting
Link with Inline Content
Link with Inline Content
Validation: Use case: Styled links with icons or emphasis
<a> can contain <span>Result: ✓ AllowedExplanation: The <a> tag can contain inline elements like <span>.Button with Icon
Button with Icon
Label with Input
Label with Input
Validation: Use case: Accessible form fields with implicit association
<label> can contain <input>Result: ✓ AllowedExplanation: Labels can wrap form controls for accessibility.Invalid Interactive Nesting
Link containing Div
Link containing Div
Validation: Why it fails: Links should contain phrasing content (inline), not block elements.
<a> cannot contain <div>Result: ✗ Not allowedExplanation: The <a> tag cannot contain block elements like <div> according to HTML5 standards.Button containing Div
Button containing Div
List Element Examples
Lists have strict parent-child relationships defined by HTML5 specifications.Valid List Nesting
Unordered List with Items
Unordered List with Items
Validation: Use case: Standard unordered lists
<ul> can contain <li>Result: ✓ AllowedExplanation: The <ul> tag can contain <li> according to specific HTML5 rules.List Item with Paragraph
List Item with Paragraph
Validation: Use case: Complex list items with multiple paragraphs
<li> can contain <p>Result: ✓ AllowedExplanation: List items can contain block or inline elements.Definition List
Definition List
Validation: Use case: Glossaries, term definitions, key-value pairs
<dl> can contain <dt> and <dd>Result: ✓ AllowedExplanation: Definition lists follow specific nesting rules.Invalid List Nesting
List with Direct Text
List with Direct Text
Validation: Why it fails: Lists must only have
<ul> cannot contain text nodes directlyResult: ✗ Not allowedExplanation: Unordered lists can only contain <li> elements as direct children.<li> elements as direct children.Void Element Examples
Void elements are self-closing and cannot contain any content.Image as Void Element
Image as Void Element
Validation: Why: Void elements have no content model.
<img> cannot contain any elementResult: ✗ Not allowedExplanation: The <img> tag is a void element and cannot contain child elements.Input as Void Element
Input as Void Element
Validation: Why: Form inputs are void elements.
<input> cannot contain any elementResult: ✗ Not allowedExplanation: The <input> tag is a void element and cannot contain child elements.Div containing Image
Div containing Image
Validation: Why: Block elements can contain void elements.
<div> can contain <img>Result: ✓ AllowedExplanation: The <div> tag can contain the void element <img>.Table Element Examples
Tables have strict structural requirements defined by HTML5.Table Structure
Table Structure
Validation: Use case: Data tables with proper semantics
<table> can contain <thead>, <tbody>, <tr>Result: ✓ AllowedExplanation: Tables follow specific semantic structure rules.Table Row with Cells
Table Row with Cells
Validation: Use case: Table rows with mixed header and data cells
<tr> can contain <td> and <th>Result: ✓ AllowedExplanation: Rows can only contain table cells.Table Cell with Content
Table Cell with Content
Validation: Use case: Rich content within table cells
<td> can contain <p>, <span>, etc.Result: ✓ AllowedExplanation: Table cells can contain block or inline elements.Form Element Examples
Forms and their controls have specific nesting rules for accessibility.Form with Fieldset
Form with Fieldset
Validation: Use case: Accessible form grouping
<form> can contain <fieldset>Result: ✓ AllowedExplanation: Forms can contain grouping elements for better organization.Select with Options
Select with Options
Validation: Use case: Dropdown menus with option groups
<select> can contain <option> and <optgroup>Result: ✓ AllowedExplanation: Select elements follow specific content rules.Media Element Examples
Multimedia elements have specific content models for sources and fallbacks.Video with Sources
Video with Sources
Validation: Use case: Responsive video with multiple formats
<video> can contain <source> and <track>Result: ✓ AllowedExplanation: Video elements can contain source elements and text fallbacks.Picture with Sources
Picture with Sources
Validation: Use case: Art direction and responsive images
<picture> can contain <source>Result: ✓ AllowedExplanation: Picture elements contain sources for responsive images.Details with Summary
Details with Summary
Validation: Use case: Expandable/collapsible content sections
<details> can contain <summary>Result: ✓ AllowedExplanation: Details elements can contain summary and other content.All examples are extracted from the validator’s actual rule engine and represent real validation scenarios you’ll encounter when using the tool.