A page can look fine in a browser even when its HTML breaks a markup rule. The W3C Nu Html Checker validates HTML markup and points to the lines that need attention.
Two elements can share an id and still look fine on screen. A link to that ID can then take visitors to the first element when they expected the second.
For a site built from templates, the generated HTML is the document to check. A fragment leaves out the page structure and any markup added by other templates.
Steps to validate HTML markup:
- Open the W3C Nu Html Checker in your browser.

- Select text input from the Check by menu.

- Replace the prefilled markup in the text field with this HTML document.
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>Opening hours</title> </head> <body> <h1>Opening hours</h1> <p id="hours">Weekdays: 9 am to 5 pm.</p> <p id="hours">Saturday: 10 am to 2 pm.</p> </body> </html>
The public checker receives the submitted source, so use only markup you are allowed to share.
- Click Check below the text field.

- Find the Duplicate ID error for
hoursbelow Checker Input.
The error points to the Saturday paragraph on line 10. The warning points to the first occurrence in the weekday paragraph on line 9.
HTML Standard rule for IDs - Change the Saturday paragraph's
idtosaturday-hoursin the text field above the report.
- Click Check again to submit the corrected HTML.

- Confirm that the report below Checker Input says No errors or warnings to show.
