Using the Validator Form
The validator consists of two input fields and a validation button:Enter the parent tag
Type the parent HTML tag name in the Parent Tag field. For example,
div, p, or button.Enter only the tag name without angle brackets. Use
div instead of <div>.Enter the child tag
Type the child HTML tag name in the Child Tag field. This is the tag you want to nest inside the parent.
Understanding Validation Results
After clicking Validate, you’ll receive one of three result types:- Allowed
- Not Allowed
- Warning
A green checkmark (✓) indicates the nesting is valid according to HTML5 standards.Example:The result includes:
- A clear “Allowed” message
- Explanation of why this combination is valid
- Code example showing proper usage
Validation Messages
The validator provides detailed, context-specific messages explaining why a combination is or isn’t allowed:Common Valid Scenarios
- Block elements containing others: “The
<div>tag is a block element and can contain block or inline elements like<p>.” - Inline elements with inline content: “The
<span>tag is an inline element and can contain other inline elements like<strong>.” - Specific allowed rules: “The
<ul>tag can contain<li>according to specific HTML5 rules.”
Common Invalid Scenarios
- Void elements as parents: “The
<img>tag is a void element and cannot contain child elements.” - Block in inline: “The
<span>tag is an inline element and cannot contain block elements like<div>according to HTML5 standards.” - Interactive nesting restrictions: “The
<button>tag cannot contain block elements like<div>according to HTML5 standards.”
Code Examples
Every validation result includes a code example showing:For valid combinations
For valid combinations
For invalid combinations
For invalid combinations
URL Parameters
You can share specific validations using URL parameters:- Loads the specified parent and child tags
- Sets the language preference
- Runs the validation immediately
- Updates the URL when you validate new combinations
Viewing Nesting Rules
Click the View nesting rules button to access a comprehensive guide covering:- Element categories (block, inline, void)
- Specific nesting rules by element type
- Best practices for valid HTML
- Common patterns to avoid
- W3C validation tool links