HTML5的doctpe:<!doctype html>
HTML不會再有版本6、7、8.....
HTML已經是一個活的標準,會隨著技術發展形成響的文檔。
瀏覽器的向后兼容性。瀏覽器會支持新以及舊內容內容。所以,規范變化時,舊的HTML照常工作。
舊有的HTML一般只能構造靜態網頁,HTML5的新元素新屬性可以支持動態網頁。
驗證所寫頁面是否合法,可以使用w3c官方驗證網站
<meta>
指定頁面的編碼格式
ex:
<meta charset="utf-8">
這一行加在<head>
元素中所有其他元素之上。
Warning!
An
<img>
element must have an <alt> attribute
some tips for HTML
- must start with
<!doctype html>
-
<html>
following after<!doctype html>
</html>
at the end of the script -
<head>``<body>
are the onnly two elements can put between<html>
&</html>
- at the begining of
<head>
,define<meta charset="utf-8">
-
<head>
must have a<title>
- be careful when you are nesting elements
- check the attributes