Web Development and Design Foundations with XHTML, 5th Edition

(Steven Felgate) #1

(^626) Appendix D Comparison of HTML 4, XHTML, and HTML 5
HTML 5 (HTML Syntax)



HTML 5 (XHTML Syntax)

D.8 Required Tags


XHTML and HTML 5 require the <head>and <body>tags. This restriction does not
apply to HTML 4.

D.9 Nesting Tags


XHTML and HTML 5 require appropriate nesting of tags. The opening and closing
container tags must nest and not overlap each other. This restriction does not apply to
HTML 4.

HTML 4
<B><EM>This is important</B></EM>

XHTML and HTML 5
<b><em>This is important</em></b>

D.10 The Tag


The <font>tag is deprecated in XHTML. The <font>tag is not part of HTML 5. It is
recommended that Web developers use CSS to configure formatting instructions instead
of the <font>tag. While CSS can be used with HTML 4, it is more common to see
<font>tags.

HTML 4
<p><FONT FACE=ARIAL>This is a sentence.</FONT></p>

XHTML and HTML 5
<p style="font-family:arial,verdana">This is a sentence.</p>
Free download pdf