Rumah >hujung hadapan web >html tutorial >HTML最佳实践_html/css_WEB-ITnose
HTML
Bad:
<html> ...</html>
Good:
<!DOCTYPE html><html> ...</html>
Bad:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
Good:
<!DOCTYPE html>
Bad:
<!DOCTYPE html>
Good:
<!DOCTYPE html>
Bad:
<p><small>Copyright © 2014 W3C<sup>®</sup></small></p>
Good:
<p><small>Copyright © 2014 W3C<sup>®</sup></small></p>
###Escape &, <, >, ", and ' 可以用字符引用
Bad:
<h1>The "&" character</h1>
Good:
<h1>The "&" character</h1>
Bad:
<p>This book can read in 1 hour.</p>
Good:
<p>This book can read in 1 hour.</p>
Bad:
<!--This section is non-normative-->
Good:
<!-- This section is non-normative -->
Bad:
<html> <body> ...
Good:
<html> <body> ...