Updating code from Quirks Mode to XHTML 1.0 Strict

2019-06-22 09:30发布

问题:

I wrote some HTML code with out a DTD (rendered via quirks mode). Sorry. Now I want to have it validated in XHTML Strict 1.0 so I added the DTD tag

I've carried these steps to make the code "clean".

  1. Verified proper nesting
  2. Verified proper closure of tags
  3. Verified proper closure of empty tags
  4. Verified lower case
  5. Verified single root element

Where can I go to validate the code?

回答1:

If you wish to validate your html, use http://validator.w3.org/



回答2:

If you really want to your code to valid then write for XHTML 1.1 and send as application/xhtml+xml. Your browser will show you where the first error occurs and it will stop parsing the code at that point.



标签: html xhtml