標(biāo)題
<h1>---<h6>最小標(biāo)題到最大標(biāo)題
搜索引擎使用標(biāo)題為您的網(wǎng)頁的結(jié)構(gòu)和內(nèi)容編制索引。很重要??!
<hr>水平線
<br>換行
文本格式化標(biāo)簽
<b>定義粗體文字? ?
<em>定義著重文字? ? ? ? <strong>定義加重語氣
<i>定義斜體字? ? ? ? ? ? ? ?<small>定義小體字
<sub>定義下標(biāo)字? ? ? ? ? ?<sup>定義下標(biāo)字
<ins>定義插入字? ? ? ? ? ? ?<del>定義刪除字
<abbr>定義縮寫? ? ? ? ? ? ? <abbr title="World Health Organization">WHO</abbr>
<address>定義地址? ? ? ? ?<code>定義代碼
<bdo>定義文字方向? ? ? ??<bdo dir="rtl">該段落文字從右到左顯示。</bdo>
鏈接
<a href="url"? ?target? ?id></a>? ??
target屬性:你可以定義被鏈接的文檔在何處顯示 。target="_blank"表示在新窗口打開;(_blank、_parent、_self、_top)
id屬性:用于創(chuàng)建在一個HTML文檔書簽標(biāo)記。(書簽是不以任何特殊的方式顯示,在HTML文檔中是不顯示的,所以對于讀者來說是隱藏的)
創(chuàng)建電子郵件鏈接:
<a href="mailto:someone@example.com?Subject=Hello%20again" target="_top">
發(fā)送郵件</a>
(單詞之間的空格需要使用%20來表示,以確保瀏覽器能真正解析空格)

使用錨跳轉(zhuǎn)到頁面的不同位置:
<a id="top">這是標(biāo)題,底部鏈接可以鏈接到這</a>
<a href="#top">鏈接到標(biāo)題</a>
這樣點擊下面的就能回到上面的,就是常常遇到的跳轉(zhuǎn)到頂部。
HTML頭部
<head>
? ? <meta>
? ? <title></title>必須的
? ? <base>標(biāo)簽描述了基本的鏈接地址/鏈接目標(biāo),作為HTML文檔中所有的鏈接標(biāo)簽的默認(rèn)鏈接
? ? <style>定義了HTML文檔的樣式文件引用地址
? ? <link>定義了文檔與外部資源之間的關(guān)系
? ? ? ? ? ? ? <link rel="stylesheet" type="text/css" href="mystyle.css">
? ??<script></script>標(biāo)簽用于加載腳本文件(一般是放在body末尾)
</head>
圖像
<img title? alt? width? height>
title:當(dāng)鼠標(biāo)放在該圖片上會顯示相關(guān)信息
alt:當(dāng)圖片加載不出來會用里面的文字代替
width和height:設(shè)置圖片的寬和高
創(chuàng)建圖像地圖:就是點擊圖像的某個位置跳轉(zhuǎn)到另外一個圖像。
<img src="planets.gif" width="145" height="126" alt="Planets" usemap="#planetmap">
<map name="planetmap">
? <area shape="rect" coords="0,0,82,126" alt="Sun" href="sun.htm">
? <area shape="circle" coords="90,58,3" alt="Mercury" href="mercur.htm">
? <area shape="circle" coords="124,58,8" alt="Venus" href="venus.htm">
</map>
表格
<table?border='1'>
<caption>Monthly savings</caption>? ?//?caption帶標(biāo)題的表格
<tr>
? ? <td?rowspan? ?colspan></td>或者是<th>Header 1</th>?
</tr>
</table>
邊框?qū)傩詁order:H5只保留了這個屬性;
表格和表頭(水平標(biāo)題和垂直標(biāo)題);
rowspan:豎跨n格;colspan:橫跨n格。
列表
<ol? ?type>有序列表? ? type="A/a/I/i//"?
<ul? ?style>無序列表? ?list-style-type
<li>列表項
<dl>自定義列表
<dt>Coffee</dt>? 列表項
<dd>- black hot drink</dd>? 列表項的描述
<dt>Milk</dt>
<dd>- white cold drink</dd>
</dl>
區(qū)塊
大多數(shù) HTML 元素被定義為塊級元素或內(nèi)聯(lián)元素。塊級元素在瀏覽器顯示時,通常會以新行來開始(和結(jié)束)<h1>, <p>, <ul>, <table>...。內(nèi)聯(lián)元素在顯示時通常不會以新行開始<b>, <td>, <a>, <img>...。
表單和輸入
<form action="html_form_action.php" method="get">
? ??<label for="male">Male</label>????為 input 元素定義標(biāo)注
? ? <textarea>? ? 定義文本域
? ? <select>? ?定義下拉列表
? ??????<option value="volvo">Volvo</option>? ? 定義選項
? ??????<optgroup label="Swedish Cars">? ? 定義選項組
????????????????<option value="volvo">Volvo</option>
????????????????<option value="saab">Saab</option>
????????</optgroup>
? ? </select>
? ? <input? type="text">? ?文本框
? ??<input type="password">? ?密碼框
? ??<input type="radio" value="male">? ? 單選框
? ? <input type="checkbox" value="male">? ?復(fù)選框
? ??<button type="button">點我!</button>? ? ?定義點擊按鈕
????<button type="submit" value="提交">提交</button>
? ? <button type="reset" value="重置">重置</button>?
? ??<input type="submit">? ? 提交按鈕
</form>
當(dāng)用戶單擊確認(rèn)按鈕時,表單的內(nèi)容會被傳送到另一個文件。表單的動作屬性定義了目的文件的文件名。由動作屬性定義的這個文件通常會對接收到的輸入數(shù)據(jù)進(jìn)行相關(guān)的處理。
H5新加表單標(biāo)簽:
<input list="browsers" name="browser">
<datalist id="browsers">? ?描述了其可能的值
? <option value="Internet Explorer">
? <option value="Firefox">
? <option value="Chrome">
? <option value="Opera">
? <option value="Safari">
</datalist>
<form oninput="x.value=parseInt(a.value)+parseInt(b.value)">0
<input type="range" id="a" value="50">100
+<input type="number" id="b" value="50">
=<output name="x" for="a b"></output>? ?作為計算結(jié)果輸出顯示
</form>
框架
<ifram? ?src="url"? ?width? ?height? ?frameborder="0"? name="iframe_a">? ?frameborder=0移除邊框
</iframe>
<a target="iframe_a"></a>? ?
通過name和target點擊鏈接在iframe中顯示頁面