html基本標籤

1、基礎標籤

<!-- 註釋標籤 -->

<h1>標題標籤</h1> //最小到6

<font>字體標籤</font> //屬性:color、size、face(字體)

<i>斜體文字</i>  <u>文字下滑線</u>  <s>文字刪除線</s>

2<sup>2</sup> //上方小字    CO<sub>2</sub> //下方小字

<br>換行 &nbsp空格

<p>段落標籤</p> //屬性:align(left、center、right)

<center>居中標籤</center>

<pre>預編譯標籤 保持原有格式不變</pre>

<big>比默認字號大一號</big>

<small>比默認字號小一號</small>

<hr/>分隔線 //屬性:color、size、width、align

<img src = "路徑\圖片名"></img> //屬性:width、height、border(邊框)、alt(圖片加載失敗顯示)

<div></div>塊標籤 <span></span>行標籤

2、超鏈接標籤

<a href = "要跳轉的頁面">跳轉頁面</a>

屬性: target(_blank在新窗口打開 _self 在自身窗口打開鏈接頁面)

name(標記)

<a name="top"></a><a href="#bottom">跳到底部</a>

<a href="#top">跳到頂部</a> <a name="bottom"></a>

圖片上的超鏈接:

<img src="a.jpg" usemap="#mymap" width=500px height=500px></img>

<map name="mymap">

<area shape="rect" coords="100,20,30,30" href="http://www.baidu.com"/> //矩形 xy座標以及長寬

<area shape="circle" coords="300,400,300" href="http://www.baidu.com" target="_blank"/> //圓形 xy座標以及半徑

</map>

3、列表標籤

1)有序列表

<ol> //屬性:type(類型可以有 a A 1 II)、start(默認從1開始)

<li>列表項</li>

<li>列表項</li>

<li>列表項</li>

<li>列表項</li>

</ol>

2)無序列表

<ul> //屬性:type(幾何圖形,默認disk)

<li>第一項描述</li>

<li>第二項描述</li>

<li>第三項描述</li>

<li>第四項描述</li>

</ul> 

3)自定義列表

<dl>

<dt>第一項

<dd>第一項描述

<dt>第二項

<dd>第二項描述

</dl>

4、表格標籤

<table> //table、tr、td屬性border、align、width、height、bgcolor、background

<caption>表格標題</caption>

<tr> //行

<th></th> <th></th> <th></th> //列

</tr>

<tr>

<td></td> <td></td> <td></td>

</tr>

<tr>

<td></td> <td></td> <td></td>

</tr>

</table>

合併單元格 屬性:colspan(左右合併個數)、rowspan(上下合併個數)

5、表單標籤

<form  action="#" method="get"></form> <!-- 表單的作用: 前臺數據和後臺的一個交互 -->

<!-- type 文本框的類型 value 默認值 name 名字 -->

<input type="text" value="" name="" size=""/> //普通表單

<input type="password"  name=""/> //密碼錶單

<input type="button" value=""/> //普通按鈕 <button>普通按鈕</button>

<input type="radio" name="sex">男<input type="radio" name="sex">女 //單選按鈕

<input type="checkbox" name="ah" value="lq"/>藍球 <input type="checkbox" name="ah" value="zq"/>足球 //多選按鈕

<input type="File"/> //上傳文件表單

<input type="reset" value="重置"/>

<input type="submit" value="提交"/>

6、框架標籤

<!-- 注意:frameset標籤和body標籤不能共存  -->

<frameset rows="25%,*" border="5px" bordercolor="#cccc00" frameborder="1" framespacing="0px">

<frame src="標題頁.html" noresize="noresize" marginheight="80px"/><!-- 上面的一塊 -->

<frameset cols="20%,*">

<frame src="列表頁.html" noresize="noresize" marginwidth="70px"/><!-- 下左 -->

<frame name="myright" scrolling="auto"/><!-- 下右 -->

</frameset>

</frameset>

7、 多媒體標籤

1)<!-- bgsound 只支持IE 瀏覽器 -->

<bgsound id="sound" src="apple.mp3" loop="-1" volume="100%" autostart="true"/>

//loop 循環次數 volume 音量 autostart 是否自啓

2)<!--audio支持聲頻資源 src資源路徑 controls 控制面板 loop是否循環 autoplay 是否自動播放 -->

<audio src="apple.mp3" controls="controls" loop="loop" autoplay="true"></audio>

3)<!-- embed 大部分瀏覽器只支持聲頻的播放  歐朋瀏覽器可以支持視頻播放 -->

<embed src="monkey.mp4" autostart="true" loop="true"></embed>

4)<video controls="controls" autoplay="true">

<source src="monkey.mp4" type="video/mp4"></source>

</video>


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