如何将HTML转换成XHTML

1. Change your DOCTYPE to Strict XHTML. Or, you can use Transitional XHTML if you’re still using Transitional HTML.
2. Add the xmlns, lang, and xml:lang attributes to your <html> opening tag.
3. The <html> tag must be the first tag after the DOCTYPE and the </html> closing tag must be the last tag in the document.
4. All element names must be written with lowercase letters.
5. All opening tags must have closing tags. Or, if an element is empty, the tag must end with a space and then />.
6. All attributes must have values, and those values must be surrounded by double quotes.
7. Don’t use & in the content of your HTML. & is for starting entities, so use &amp; instead. Also convert any other special characters to entities.

posted on 2010-12-10 14:47  SF.Terry  阅读(2865)  评论(0编辑  收藏  举报

导航