歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux編程 >> Linux編程 >> HTML5入門基礎教程

HTML5入門基礎教程

日期:2017/3/1 9:38:37   编辑:Linux編程

1.在html發展歷史中,最廣為人知的是html3.2和html4.01.

2.將html與xml的長處加以結合,從而得到xhtml,xhtml是更嚴格、更純淨的html代碼。

3.W3C組織使用DTD(Document Type Definition,文檔類型定義)來定義html和xhtml的語義約束,包括出現那些元素,支持哪些屬性。

4.html5是規范制定者對現實的妥協。

--------------------------------------分割線 --------------------------------------

HTML5 地理位置定位(HTML5 Geolocation)原理及應用 http://www.linuxidc.com/Linux/2012-07/65129.htm

HTML5移動開發即學即用(雙色) PDF+源碼 http://www.linuxidc.com/Linux/2013-09/90351.htm

HTML5入門學習筆記 http://www.linuxidc.com/Linux/2013-09/90089.htm

HTML5移動Web開發筆記 http://www.linuxidc.com/Linux/2013-09/90088.htm

HTML5 開發中的本地存儲的安全風險 http://www.linuxidc.com/Linux/2013-06/86486.htm

《HTML5與CSS3權威指南》及相配套源碼 http://www.linuxidc.com/Linux/2013-02/79950.htm

關於 HTML5 令人激動的 10 項預測 http://www.linuxidc.com/Linux/2013-02/79917.htm

HTML5與CSS3實戰指南 PDF http://www.linuxidc.com/Linux/2013-02/79910.htm

--------------------------------------分割線 --------------------------------------

5.HTML5的優勢

1>主流浏覽器:IE(9)、chrome、firefox(firefox4)、opera(opera10)、safari(safari5)

2>部分替代了原來的js:如自動獲取焦點:<input type=text autofocus name=price>

3>更明確的語義支持:代替清一色的div頁面結構

<!DOCTYPE HTML>

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Website Title</title>
</head>

<body>

<strong> <header>
<nav></strong>
<ul>
<li>Home</li>
<li>Contact</li>
</ul>
<strong> </nav>
</header>

<section>

<article> </strong>
<header>
<h2>Title Goes here</h2>
<p>Posted on <time datetime="2012-07-28T13:00:24+01:00">July 28th 2012</time> by <a href="#">Author</a> - <a href="#comments">12 comments</a></p>
</header>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry.</p>
<strong> </article>

<article></strong>
<header>
<h2>Article title</h2>
<p>Posted on <time datetime="2012-07-26T13:00:24+01:00">July 26th 2012</time> by <a href="#">Author</a> - <a href="#comments">9 comments</a></p>
</header>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry.</p>
<strong></article>

</section>

<aside> </strong>
<h2>Contact Us</h2>
<p>It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout.</p>
<strong> </aside>

<footer></strong>
<p>Copyright 2012 DigiMantra Labs ?</p>
<strong> </footer> </strong>

</body>

</html>

上述<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 可以簡化為<meta charset="UTF-8" />

<em>元素表示被強調,可以用以下:

<time>2014-08-02</time>

<mark>被標記的文本</mark>

4>增強了web應用程序的功能

6.html5的基本結構:

<! DOCTYPE html>: DTD定義

基本結構像5.3>代碼所示

7.html5的語法變化

1>標簽不再區分大小寫

2>元素可以省略結束標簽

eg:img、input、hr、embed、link、p、tr、td、th、thead、tbody等,可以省略全部標簽的元素:html、head、body、tbody。

3>可以省略屬性值得屬性

eg:selected、disabled、checked、readonly、multiple、nowrap等

4>允許屬性值不使用引號(含有空格等容易引起浏覽器混淆的屬性值建議用引號)

8.注意:

不要在<html>和<head>之間插入任何內容!

不要在</head>和<body>之間插入任何內容!

不要在</body>和</html>之間插入任何內容!

更多詳情見請繼續閱讀下一頁的精彩內容: http://www.linuxidc.com/Linux/2014-10/108206p2.htm

Copyright © Linux教程網 All Rights Reserved