標籤:語言 set 部分 lis 引導 標記 step htm 輸入框
1.html5:全球資訊網的核心語言、HTML規範的第五次重大修改。HTML是一種標記語言。
2.布局的語義化標籤:
article:標籤裝載顯示一個獨立的文章內容
section :標籤定義文檔中的節
aside:用來裝載非本文類的內容
header :標籤定義文檔的頁面頭部,通常是一些引導和導航資訊
footer : 標籤定義 section 或 document 的頁尾
nav :標籤定義顯示導航連結
他們的使用情境代碼如下:
1 <!DOCTYPE html> 2 <html> 3 <head lang="en"> 4 <meta charset="UTF-8"> 5 <title> Html5標籤布局</title> 6 <style> 7 *{ 8 margin: 0; 9 padding: 0;10 }11 header{12 width: 1000px;13 height: 90px;14 background: #9cf1fd;15 margin-left: 150px;16 }17 p{18 margin-left: 20px;19 }20 nav{21 width: 950px;22 height: 30px;23 line-height: 30px;24 text-align:left;25 background: #e9fad0;26 margin-top: 20px;27 margin-left: 20px;28 }29 article{30 width: 700px;31 height: 400px;32 background: #b2d5fd;33 margin-top: 10px;34 margin-left: 150px;35 }36 section{37 width: 650px;38 height: 100px;39 margin-left: 20px;40 margin-top: 20px;41 background: #fcb062;42 float: left;43 }44 aside{45 width: 280px;46 height: 400px;47 float: right;48 margin-top: -400px;49 margin-right: 125px;50 background: #c8b1e7;51 }52 footer{53 width: 1000px;54 height: 40px;55 background: #78def3;56 margin-left: 150px;57 margin-top: 10px;58 }59 60 </style>61 </head>62 <body>63 <header>64 <p>header</p>65 <nav>66 <p>nav</p>67 </nav>68 </header>69 <article>70 <p>article</p>71 <section><p>section</p></section>72 <section><p>section</p></section>73 <section><p>section</p></section>74 </article>75 <aside><p>aside</p></aside>76 <footer>77 <p>footer</p>78 </footer>79 </body>80 </html>
3.標題語義化標籤
<hgroup> 標籤用於對網頁或區段(section)的標題進行組合.
1 <hgroup class="hgroup">2 <h2>會議內容</h2>3 <h2>會議主題</h2>4 </hgroup>
4.媒體語義化標籤
<figure>: 標籤包含獨立的媒體內容
<figcaption> 標籤定義 figure 元素的標題
<figure> <img src="../../img/8.jpg" alt=""/> <figcaption>這是黑夜</figcaption><!--圖片注釋--></figure>
5.標記標籤
<mark> 在需要反白文本時使用 <mark> 標籤。
<p><mark>我的騎士</mark></p><!--mark預設背景色是黃色 標記字型-->
6.詳細資料標籤
<details> 標籤用於描述文檔或文檔某個部分的細節,而這個細節並不需要文檔載入時就展示,而是可以摺疊。
<summary> 預設顯示的details 元素的標題。
1 <details open="open">2 <!--//option預設導航為開啟狀態-->3 <summary>導航1</summary>4 <p>導航內容1</p>5 <p>導航內容2</p>6 <p>導航內容3</p>7 </details>
7.進度列標籤
<progress> 標籤定義運行中的進度(進程)
<progress max="100" value="90"></progress>
8.新增表單類型
<datalist> 標籤定義選項列表。請與 input 元素配合使用該元素,來定義 input 可能的值。
1 <input type="search" list="A"/>2 <datalist id="A">3 <option>111</option>4 <option>222</option>5 <option>321</option>6 <option>444</option>7 <option>555</option>8 </datalist>
9.新增表單輸入類型
email ---- 郵箱驗證【@】
url ---- 網址IME【http://www.xx.xx】
number --- (min、max、step數字間隔、value)
range --- (min、max、step數字間隔、value)---進度條
color ---- 檢色器
date ---- 選取日、月、年
month ---- 選取月、年 week - 選取周和年
time ---- 選取時間(小時和分鐘)
datetime ---- 選取時間、日、月、年(UTC 時間)
datetime-local ---- 選取時間、日、月、年(本地時間)
1 <form> 2 <input type="email"/> <!--required必填提示【不可為空】 ,email郵箱驗證【@】--> 3 4 <input type="url" /> <!--網址IME【http://www.xx.xx】--> 5 6 <input type="number" min="0" max="10"/> <!--購物車【min最小值數,max最大值數】--> 7 8 <input type="range" min="0" max="10" step="5"/> <!--進度條--> 9 <input type="color"/> <!--檢色器-->10 <form>
10.新增表單屬性
placeholder : 輸入框提示資訊
autofocus : 指定表單擷取輸入焦點
required : 必須要填寫的欄位
pattern : 正則驗證 pattern="\d{1,5}"
1 <input type="text" placeholder="請輸入內容1 " required="required" pattern="\d{1,5}"/>2 <input type="text" placeholder="請輸入內容2 " autofocus="autofocus"/>
Html5相關的知識點總結