html5基礎知識

來源:互聯網
上載者:User

標籤:style   http   os   使用   io   ar   for   檔案   art   

html5

<!DOCTYPE>標籤
html5隻有一種,即:
<!DOCTYPE HTML>

樣本:
<!DOCTYPE html>
<html>
<head>
<title>html5_title</title>
</head>
<body>
html5內容
</body>
</html>
---------------------
<a>標籤
download屬性,下載指定的檔案(lin.gif),且下載的檔案名稱為 lin3615.gif
樣本:
<a href="images/lin3615.gif" download="lin3615.gif">
<img src="lin.gif" />
</a>

media屬性

type屬性,規定目的文件的MIME類型
樣本:
<a href="http://www.lin3615.net/" type="text/html">lin3615</a>
-----------------
<article>標籤
規定獨立的自包含的內容(只是一種標記而已)
樣本:
<body>
<article>
<h1>hhhh</h1>
<p>pppp</p>
</article>
</body>
---------------------
<aside>標籤
定義其所處內容之外的內容(一種標記而已)
樣本:
<body>
<p>ppp</p>
<aside>
<h3>hhhhh</h3>
hhhhh 的詳細解釋
</aside>
</body>
-----------------
<audio>標籤
定義聲音內容
樣本:
<body>
<audio src="myvoice.ogg" controls="controls">
當瀏覽器不支援時將顯示的內容
</audio>
</body>
其中屬性列表:
autoplay="autoplay"
則音頻在就緒後馬上播放

controls="controls"
則向使用者顯示控制項,如播放按鈕

loop="loop"
則每當音頻結束時重新開始播放

muted="muted"
視頻輸出應該被靜音

preload="preload"
音頻在頁面載入時進行載入,並預備播放,如果用 "autoplay",則 preload 被忽略

src="url"
要播放的音訊 url
---------------------
<button>標籤,建議用 input代替
屬性列表
autofocus="autofocus"
當頁面載入時按鈕應當自動獲得焦點

form="form_name"
按鈕屬於一個或多個表單

formaction="url"
覆蓋 form元素的 action屬性,與 type="submit"配合使用

formenctype=""
覆蓋form元素的 enctype屬性,與 type="submit"配合使用

formmethod="get" / "post"
覆蓋 form元素的 method屬性,與 type="submit"配合使用

formnovalidate="formnovalidate"
覆蓋form元素 novalidate屬性,與 type="submit"配合使用

formtarget="_blank/_self/_parent/_top"
覆蓋 form元素的 target屬性,與 type="submit"配合使用
--------------------
<canvas>標籤(大學問)
用來定義圖形,只是一個圖形容器,必須使用指令碼來繪製圖形
<body>
<canvas id="myCanvas">
瀏覽器不支援
</canvas>
<script>
var canvas=document.getElementById(‘myCanvas‘);
var ctx = canvas.getContent(‘2d‘);
ctx.fillStyle=‘#ff0000‘;
ctx.fillRect(10,10,80,100);
</script>
</body>
-------------------------
command命令按鈕,只有ie9支援
------------------------
<details>
定義下拉式清單,與 input 結合,datalists及其選項不會被顯示出來,僅僅是合法的輸入值列表,使用 input元素的 list屬性來綁定 datalists
樣本:
<body>
<input list="cars" />
<datalist id="cars">
    <option value="1111"></option>
    <option value="2222"></option>
    <option value="3333"></option>
</datalist>
</body>
---------------------
<dialog open="open">標籤
使用者互動的,只有 safari/chrome支援
-------------------
<embed>標籤
定義外部互動內容或外掛程式
屬性工作表:
height: 設定嵌入內容高度
src:url 嵌入的內容 url
type:定義嵌入內容的 類型
width:設定嵌入內容寬度
樣本:
<body>
<embed src="ok.swf" />
</body>
-------------------






html5基礎知識

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.