Web Development and Design Foundations with XHTML, 5th Edition

(Steven Felgate) #1
Appendix D Comparison of HTML 4, XHTML, and HTML 5^623

HTML 5


<!doctype html>


HTML 5 (XHTML Syntax)


<!doctype html>
Optional if the document is servedas XML
Required if the document is served as text/html


The Tag


XHTML requires that the root element (immediately after the DTD) is an tag
that refers to the XML namespace. HTML 4 has no such requirement. To assist the
interpreting of page content by search engines and screen readers, use the lang attribute
to indicate the spoken language of the Web page content. See http://www.w3.org/TR/
REC-html40/struct/dirlang.html#adef-lang.


HTML 4



XHTML



HTML 5 (HTML Syntax)



HTML 5 (XHTML Syntax)



D.3 Uppercase versus Lowercase


The HTML 4 standard recommends that tags and attributes use uppercase. The
XHTML standard follows XML syntax, which requires lowercase.


HTML 4



XHTML



HTML 5 (HTML Syntax)


Either

or


Note: lowercase is preferred.