HTML Tags Checker runs entirely in your browser - no installation, server, or dependencies required. Just download and open!
Installation
Get up and running with HTML Tags Checker in three simple steps:Download the repository
Clone or download the HTML Tags Checker repository to your computer:Or download the ZIP file from GitHub and extract it to your preferred location.
Open in your browser
No build process or server setup needed! Simply open the Or just double-click the
index.html file in your web browser:index.html file in your file explorer.Basic Usage
Follow these steps to validate HTML tag nesting:Enter the parent tag
Type the parent HTML tag name in the first input field (without angle brackets):
Review the results
The tool displays:
- Validation status: ✓ Allowed, ✗ Not Allowed, or ⚠ Allowed with Warning
- Explanation: Why the nesting is valid or invalid
- Code example: A practical example of the nesting
Understanding validation results
Understanding validation results
The validator provides three types of results:
- ✓ Allowed (Green): The nesting is valid according to W3C standards
- ✗ Not Allowed (Red): The nesting violates HTML5 rules
- ⚠ Warning (Yellow): The nesting is technically allowed but may have caveats
Quick Examples
Try these common validation scenarios to get familiar with the tool:Example 1: Valid Block Nesting
Test: Can<div> contain <p>?
Steps:
- Enter
divin the parent tag field - Enter
pin the child tag field - Click Validate
Explanation: The
<div> tag is a block element and can contain block or inline elements like <p>.
Example 2: Invalid Inline to Block
Test: Can<span> contain <div>?
Steps:
- Enter
spanin the parent tag field - Enter
divin the child tag field - Click Validate
Explanation: The
<span> tag is an inline element and cannot contain block elements like <div> according to HTML5 standards.
Example 3: Paragraph Restrictions
Test: Can<p> contain <div>?
Steps:
- Enter
pin the parent tag field - Enter
divin the child tag field - Click Validate
Explanation: The
<p> tag can only contain inline content (text and inline elements), not block elements.
Example 4: Valid Inline Nesting
Test: Can<a> contain <span>?
Steps:
- Enter
ain the parent tag field - Enter
spanin the child tag field - Click Validate
Explanation: The
<a> tag can contain inline elements like <span>.
Example 5: Void Element Parent
Test: Can<img> contain <span>?
Steps:
- Enter
imgin the parent tag field - Enter
spanin the child tag field - Click Validate
Explanation: The
<img> tag is a void element and cannot contain child elements.
Example 6: Table Structure
Test: Can<table> contain <tr>?
Steps:
- Enter
tablein the parent tag field - Enter
trin the child tag field - Click Validate
Explanation: The
<table> tag can contain <tr> elements for table rows.
Example 7: List Elements
Test: Can<ul> contain <li>?
Steps:
- Enter
ulin the parent tag field - Enter
liin the child tag field - Click Validate
Explanation: The
<ul> tag can contain <li> elements as list items.
Using the Language Switcher
The tool supports both Spanish and English interfaces:- Look for the language selector buttons in the top-right corner (ES | EN)
- Click your preferred language
- The entire interface updates instantly, including:
- Form labels
- Button text
- Validation messages
- Code examples
- Modal content
The language preference is saved in the URL, so you can bookmark or share links with your preferred language.
Viewing the Nesting Rules Guide
For a comprehensive reference of HTML nesting rules:- Click the “View nesting rules” button below the title
- A modal opens with detailed information about:
- Element categories (block, inline, void)
- Specific nesting rules by element type
- Best practices for valid HTML
- Browse through the collapsible sections for the information you need
- Close the modal by:
- Clicking the × button
- Clicking outside the modal
- Pressing the Escape key
Advanced Features
URL Parameters
You can share specific validations using URL parameters:parent- The parent tag to validatechild- The child tag to validatelang- Interface language (esoren)
<span> can contain <div> in English.
Learn more about URL parameters in the URL Parameters documentation.
Keyboard Accessibility
The tool is fully keyboard-accessible:- Tab - Navigate between form fields and buttons
- Enter - Submit the validation form
- Escape - Close the nesting rules modal
- Tab (in modal) - Navigate modal content with focus trapping
Common Use Cases
Learning HTML
Students can test tag combinations to understand HTML structure and nesting rules interactively.
Code Review
Quickly verify if a specific tag nesting pattern in your code follows W3C standards.
Teaching
Teachers can use URL parameters to create pre-filled examples for students to explore.
Debugging
Identify why certain HTML structures aren’t rendering as expected by checking nesting validity.
Troubleshooting
The page won't load
The page won't load
- Ensure you’re opening
index.html(notindex.jsor other files) - Try a different browser (Chrome, Firefox, Edge, Safari)
- Check that all three files are present:
index.html,index.js,styles.css - Clear your browser cache and reload
Validation results seem incorrect
Validation results seem incorrect
- Remember that HTML5 nesting rules are specific and sometimes counterintuitive
- Check the Nesting Rules Reference for detailed explanations
- Some rules differ from older HTML versions (HTML4, XHTML)
- The tool follows current W3C HTML5 specifications
Language switcher not working
Language switcher not working
- The language should switch instantly when you click ES or EN
- Try refreshing the page if the switch doesn’t occur
- Check that JavaScript is enabled in your browser
- The default language is Spanish (
es)
Modal won't open or close
Modal won't open or close
- Try clicking the “View nesting rules” button again
- Press the Escape key to close the modal
- Refresh the page if the modal is stuck
- Check browser console for JavaScript errors
Next Steps
Now that you’re familiar with the basics, explore more advanced topics:Core Concepts
Understand the underlying HTML nesting rules and element categories
Usage Guide
Learn detailed usage patterns and explore more examples
Developer Guide
Integrate the tool into your workflow or customize it for your needs
Reference
Browse the complete reference of supported elements and rules