HTML開發簡記

1:WHATWG---網頁超文本應用技術工作小組是一個以推動網絡HTML 5 標準爲目的而成立的組織。在2004年,由Opera、Mozilla基金會和蘋果這些瀏覽器廠商組成。WHATWG 致力於 web 表單和應用程序.
2:定義文字方向。
<bdo dir="rtl">ltr
Here is some Hebrew text
</bdo>
3:定義長的引用。
<blockquote>
This is a long quotation. This is a long quotation. This is a long quotation. This is a long quotation. This is a long quotation.
</blockquote>
4:定義被刪除文本。
<p>一打有 <del>二十</del> <ins>十二</ins> 件。</p>
5:
<tt>:呈現類似打字機或者等寬的文本效果。
<i>:顯示斜體文本效果。
<b>:呈現粗體文本效果。
<big>:呈現大號字體效果。
<small>:呈現小號字體效果。
<pre>:定義預格式文本。
<q>:定義短的引用。<p>Here comes a short quotation: <q>This is a short quotation</q></p>
效果:Here comes a short quotation: "This is a short quotation"
<strong>:定義語氣更爲強烈的強調文本。
<sup>:定義上標文本。
<sub>:定義下標文本。
<optgroup>:定義選擇列表中相關選項的組合。
<select>
  <optgroup label="Swedish Cars">
    <option value="volvo">Volvo</option>
    <option value="saab">Saab</option>
  </optgroup>
  <optgroup label="German Cars">
    <option value="mercedes">Mercedes</option>
    <option value="audi">Audi</option>
  </optgroup>
</select>
--<fieldset>:定義圍繞表單中元素的邊框。
<form>
  <fieldset>
    <legend>健康信息</legend>               //定義 fieldset 元素的標題。
    身高:<input type="text" />
    體重:<input type="text" />
  </fieldset>
</form>
6:框架
--<frame>:定義框架集的窗口或框架。 

屬性:
--frameborder:0 1--規定是否顯示框架周圍的邊框。
--longdesc:規定一個包含有關框架內容的長描述的頁面。
--marginheight:定義框架的上方和下方的邊距。
--marginwidth:定義框架的左側和右側的邊距。
--name:規定框架的名稱。
--noresize:noresize--規定無法調整框架的大小。
--scrolling:yes no auto:規定是否在框架中顯示滾動條。
--src:規定在框架中顯示的文檔的 URL。

--<frameset>:定義框架集。

屬性:
--cols:pixels % *:定義框架集中列的數目和尺寸。
--rows:pixels % *:定義框架集中行的數目和尺寸。

--<noframes>:定義針對不支持框架的用戶的替代內容。
<frameset cols="25%,50%,25%">
  <frame src="/example/html/frame_a.html">
  <frame src="/example/html/frame_b.html">
  <frame src="/example/html/frame_c.html">


<noframes>
<body>您的瀏覽器無法處理框架!</body>
</noframes>


</frameset>
---<iframe>:定義內聯框架。
<iframe src="/i/eg_landscape.jpg"></iframe>

屬性:
--frameborder
--height
--longdesc
--marginheight
--marginwidth
--name
--scrolling
--src
--width
新:
--sandbox:啓用一系列對 <iframe> 中內容的額外限制。
--seamless:seamless--:規定 <iframe> 看上去像是包含文檔的一部分。
--srcdoc:HTML_code:--規定在 <iframe> 中顯示的頁面的 HTML 內容。

7:圖像
--<img>:定義圖像。
<img src="/i/eg_tulip.jpg"  alt="上海鮮花港 - 鬱金香" />

屬性:
--alt:規定圖像的替代文本。
--src:規定顯示圖像的 URL。

--<map>:定義圖像映射。
定義一個客戶端圖像映射。圖像映射(image-map)指帶有可點擊區域的一幅圖像。
<img src="planets.jpg" border="0" usemap="#planetmap" alt="Planets" />


<map name="planetmap" id="planetmap">
  <area shape="circle" coords="180,139,14" href ="venus.html" alt="Venus" />
  <area shape="circle" coords="129,161,10" href ="mercur.html" alt="Mercury" />
  <area shape="rect" coords="0,0,110,260" href ="sun.html" alt="Sun" />
</map>

屬性:必需的屬性--id:爲 map 標籤定義唯一的名稱。
      可選的屬性--name:爲 image-map 規定的名稱。

--<area>:定義圖像地圖內部的區域。
8:鏈接
--<a>:定義錨。
<a href="http://www.w3school.com.cn">W3School</a>

屬性:
--charset:規定被鏈接文檔的字符集。
--coords:規定鏈接的座標。
--href:URL--:規定鏈接指向的頁面的 URL。
--hreflang:language_code--:規定被鏈接文檔的語言。
--shape:default、rect、circle、poly:規定鏈接的形狀。
--target:_blank、_parent、_self、_top:規定在何處打開鏈接文檔。
新屬性:
--download:filename:規定被下載的超鏈接目標。
<a href="/images/myw3schoolimage.jpg" download="w3logo">
--media:media_query:規定被鏈接文檔是爲何種媒介/設備優化的。
--type:MIME type--:規定被鏈接文檔的的 MIME 類型。
<a href="http://www.w3school.com.cn" type="text/html">W3School</a>

--<link>:定義文檔與外部資源的關係。
<link rel="stylesheet" type="text/css" href="theme.css" />

屬性:
--charset
--href
--hreflang:language_code--:規定被鏈接文檔中文本的語言。
--media:media_query--:規定被鏈接文檔將被顯示在什麼設備上。
--rel:alternate、author、help、icon、licence、next、pingback、prefetch、prev、search、sidebar、
      stylesheet、tag:規定當前文檔與被鏈接文檔之間的關係。
--rev:。。。。--:與上相反
--target:
--type:MIME_type       規定被鏈接文檔的 MIME 類型。

9:表單
--<ul>:定義無序列表。
屬性:type:disc、circle、square--實心圓。空心圓。實心方塊。
--<ol>:定義有序列表。

屬性:
--start:number  規定有序列表的起始值。
<ol start="5">
   <li>HTML</li>
   <li>XHTML</li>
   <li>CSS</li>
</ol>
--type:1 A a I i--:規定在列表中使用的標記類型。
新--reversed:reversed--:   對列表順序進行降序:<ol reversed>

--<li>:定義列表的項目。

屬性:
--type:A a I i 1 disc square circle
--value:number--:規定列表項目的數字。

--<dir>:不贊成使用。定義目錄列表。
--<dl>:定義定義列表。
<dl>
   <dt>計算機</dt>                  //定義列表中的項目
   <dd>用來計算的儀器 ... ...</dd>  //描述列表中的項目
   <dt>顯示器</dt>
   <dd>以視覺方式顯示信息的裝置 ... ...</dd>
</dl>
--<dt>:定義定義列表中的項目。
--<dd>:定義定義列表中項目的描述。
--<menu>:定義命令的菜單/列表。
<menu type="toolbar">
 <li>
 <menu label="File">
 <button type="button" οnclick="file_new()">New...</button>
 <button type="button" οnclick="file_open()">Open...</button>
 <button type="button" οnclick="file_save()">Save</button>
 </menu>
 </li>
 <li>
 <menu label="Edit">
 <button type="button" οnclick="edit_cut()">Cut</button>
 <button type="button" οnclick="edit_copy()">Copy</button>
 <button type="button" οnclick="edit_paste()">Paste</button>
 </menu>
 </li>
</menu>
--<menuitem>:定義用戶可以從彈出菜單調用的命令/菜單項目。
新:
<command>:定義命令按鈕。
10:表格
--<table> 定義表格

屬性:
--border:規定表格邊框的寬度。
--cellpadding:規定單元邊沿與其內容之間的空白。
--cellspacing:規定單元格之間的空白。
--frame:void、above、below、hsides<上下>、lhs、rhs、vsides<左右>、box、border:規定外側邊框的哪個部分是可見的。
--rules:none、groups、rows、cols、all:規定內側邊框的哪個部分是可見的。
--summary:text--:規定表格的摘要。
--width:規定表格的寬度。

--<caption> 定義表格標題。
<caption>我的標題</caption>
--<th>        定義表格中的表頭單元格。

屬性:
--align:left、right、center、justify、char:規定單元格內容的水平對齊方式。
--rowspan:number--:規定單元格可橫跨的行數。
--valign:top、middle、bottom、baseline:規定單元格內容的垂直排列方式。

--<tr>        定義表格中的行。
--<td>        定義表格中的單元。

屬性:
--align
--axis:對單元進行分類。
--colspan:規定單元格可橫跨的列數。
--headers:規定與單元格相關的表頭。
<tr>
    <th id="name">Name</td>
 </tr>
  <tr>
    <td headers="name">George Bush</td>
</tr>


td屬性:
--height
--nowrap
--rowspan:規定單元格可橫跨的行數。
--valign:規定單元格內容的垂直排列方式。
--width

--<thead> 定義表格中的表頭內容。
--<tbody> 定義表格中的主體內容。
--<tfoot> 定義表格中的表注內容(腳註)。
--<col>        定義表格中一個或多個列的屬性值。
--<colgroup> 定義表格中供格式化的列組。
















二:HTML5新標籤
1:<mark>:定義有記號的文本。<mark>milk</mark>
<meter>:定義預定義範圍內的度量。<meter value="3" min="0" max="10">十分之三</meter>
<meter value="0.6">60%</meter>
<progress>:定義任何類型的任務的進度。下載進度:
<progress value="22" max="100">
</progress>
<time>:定義日期/時間。<p>我們在每天早上 <time>9:00</time> 開始營業。</p>


<p>我在 <time datetime="2008-02-14">情人節</time> 有個約會。</p>
<wbr>:切割單詞換行。如果想學習 AJAX,那麼您必須熟悉 XML<wbr>Http<wbr>Request 對象。
--<datalist>:定義下拉列表。
<input list="cars" />
<datalist id="cars">
<option value="BMW">
<option value="Ford">
<option value="Volvo">
</datalist>
--<keygen>:定義生成密鑰。
<form action="/example/html5/demo_form.asp" method="get">
用戶名:<input type="text" name="usr_name" />
加密:<keygen name="security" />
<input type="submit" />
</form>
--<output>:定義輸出的一些類型。
<form οninput="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>
</form>
2:圖像
--<canvas>:定義圖形。
<canvas id="myCanvas" width="200" height="200" style="border:1px solid">
Your browser does not support the canvas element.
</canvas>


<script type="text/javascript">
var c=document.getElementById("myCanvas");
var cxt=c.getContext("2d");
cxt.fillStyle="#92B901";
cxt.fillRect(50,50,100,100);
</script>
(
新屬性:height  width
)
--<figcaption>:定義 figure 元素的標題。
<figure>
  <figcaption>黃浦江上的的盧浦大橋</figcaption>
  <img src="/i/shanghai_lupu_bridge.jpg" width="350" height="234" />
</figure>
--<figure>:定義媒介內容的分組,以及它們的標題。
3:音頻/視頻
--<audio>:定義聲音內容。
<audio src="/i/horse.ogg" controls="controls">
Your browser does not support the audio element.
</audio>

屬性:
--autoplay:autoplay--:如果出現該屬性,則音頻在就緒後馬上播放。
--controls:controls--:如果出現該屬性,則向用戶顯示控件,比如播放按鈕。
--loop:loop--:如果出現該屬性,則每當音頻結束時重新開始播放。
--muted:muted--:規定視頻輸出應該被靜音。
--preload:preload--:如果出現該屬性,則音頻在頁面加載時進行加載,並預備播放。
如果使用 "autoplay",則忽略該屬性。
--src:url--:要播放的音頻的 URL。

--<source>:定義媒介源。
<audio controls>
<source src="/i/horse.ogg" type="audio/ogg">
<source src="/i/horse.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>

屬性:
--media:規定媒體資源的類型。
--src:url--:規定媒體文件的 URL。
--type:規定媒體資源的 MIME 類型。

--<track>:定義用在媒體播放器中的文本軌道。
播放帶有字幕的視頻:
<video width="320" height="240" controls="controls">
  <source src="forrest_gump.mp4" type="video/mp4" />
  <source src="forrest_gump.ogg" type="video/ogg" />
  <track kind="subtitles" src="subs_chi.srt" srclang="zh" label="Chinese">
  <track kind="subtitles" src="subs_eng.srt" srclang="en" label="English">
</video>

屬性:
--default:default--:規定該軌道是默認的,假如沒有選擇任何軌道。
--kind:captions、chapters、descriptions、metadata、subtitles--表示軌道屬於什麼文本類型。
--label:軌道的標籤或標題。
--src:軌道的 URL。
--srclang:軌道的語言,若 kind 屬性值是 "subtitles",則該屬性必需的。

--<video>:定義視頻。
<video src="/i/movie.ogg" controls="controls">
your browser does not support the video tag
</video>

屬性:
--autoplay
--controls
--height
--loop
--muted
--poster:URL--:規定視頻下載時顯示的圖像,或者在用戶點擊播放按鈕前顯示的圖像。
--preload:
--src
--width

4:鏈接
--<nav>:定義導航鏈接。
<nav>
<a href="index.asp">Home</a>
<a href="html5_meter.asp">Previous</a>
<a href="html5_noscript.asp">Next</a>
</nav>
<nav> 標籤定義導航鏈接的部分。提示:如果文檔中有“前後”按鈕,則應該把它放到 <nav> 元素中。
5:樣式/節
--<header> 定義 section 或 page 的頁眉。
--<footer> 定義 section 或 page 的頁腳。
--<section> 定義 section。
--<article> 定義文章。 標籤規定獨立的自包含內容


--<aside> 定義頁面內容之外的內容。
--<details> 定義元素的細節。
<details>
<summary>Copyright 2011.</summary>
<p>All pages and graphics on this web site are the property of W3School.</p>
</details>
--<dialog> 定義對話框或窗口。
--<summary> 爲 <details> 元素定義可見的標題。
6:元信息
--<head> 定義關於文檔的信息。

下面這些標籤可用在 head 部分:<base>, <link>, <meta>, <script>, <style>, 以及 <title>。
<title> 定義文檔的標題,它是 head 部分中唯一必需的元素。

--<meta> 定義關於 HTML 文檔的元信息。

屬性:
必需的屬性:
--content:some_text--:定義與 http-equiv 或 name 屬性相關的元信息
可選的屬性:
--http-equiv--:content-type、expires、refresh、set-cookie:把 content 屬性關聯到 HTTP 頭部。
--name:author、description、keywords、generator、revised、others:把 content 屬性關聯到一個名稱。
--scheme:some_text--:定義用於翻譯 content 屬性值的格式。

--<base> 定義頁面中所有鏈接的默認地址或默認目標。
--<basefont> 不贊成使用。定義頁面中文本的默認字體、顏色或尺寸。







發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章