標籤:tar bsp 邊框 內容 單詞 html4 按鈕 標記 reset
HTML:超文字標記語言 (HTML),是用來描述網頁的一種語言。是一套標記標籤。
標籤是由 角括弧 包圍的關鍵詞
標籤通常是 成對出現的
Web瀏覽器的作用是讀取HTML文檔,並以網頁的形式顯示。
亂碼:HTML4.0 :<meta http-equiv="content-type" content="text/html;charset=utf-8">
HTML5.0:<meta charset="utf-8">
meta:中繼資料
相對路徑:相對當前檔案的路徑
絕對路徑:網路資源路徑和全路徑
<meta>:中繼資料
引入的元素都放在<head>中
設定顏色用:1、顏色所對應的英文單詞;2、RGB值;
<a>超連結</a> 行級標籤
超連結標籤:<a href="連結地址" target="開啟檔案(當前頁面還是新頁面)"></a>
定義網頁錨點
<a name="four">第四章</a>
連結當前網頁錨點
<a href="#four">第四章</a>
連結目標網頁的錨點
<a href="目標網址#four"></a>
表格標籤:
定義:<table></table>
border="1"表格邊框為1像素
align="center"表格相對瀏覽器頁面位置center/left/right
width="50%" 表格寬度。50%表示占頁面比例
定義表格高度:style="height: 500px"
rules="":規定內側邊框的哪個部分是可見的。
<tr></tr>定義表格中的行
<td></td>定義表格中的列
rowspan="3":合并3行
colspan=:3":合并3列
表單標籤
<form action=""></from>
method="get":預設的提交方式,會顯示使用者名稱和密碼,不安全
method="post":安全的提交方式,不會顯示使用者資訊
文字框: <input type="text" value="請輸入使用者名稱" maxlength="5" />
密碼框:<input type="password" maxlength="6"/>
單選框:<input type="radio" name="sex" checked="checked"/>男<input type="radio" name="sex"/>女
提交表單: <input type="submit" value="註冊"/>
多選框: <input type="checkbox"/>吃飯 <input type="checkbox"/>睡覺
頭像選擇: <input type="file" />
設定圖片提交: <input type="image" src="myimg/1.jpg"/>
功能鍵:<input type="reset" value="清空"/><input type="button" value="按鈕"/>
下拉框:<select>
<option>--請選擇--</option>
<option>四川</option>
<option>北京</option>
<option>雲南</option>
</select>
文本域:
<textarea rows="3" cols="" >
xxxxx
</textarea>
唯讀:readonly="readonly"
不可用(灰色):disbale="disbale"
最大長度:maxlength="5";
預設:checked="checked"
HTML5新特性:
添加郵箱:<input type="email"/>
元素分組:
<fieldset>
<legend>必填選項</legend>
<table>
<tr>
<tb>姓名:</tb>
<td><input type="text"/></td>
</tr>
</table>
</fieldset>
<!--範圍標籤--突出表現所包含內容--->
價格:<span style="color: red;font-size: 25px">100</span>元
<!--Lable標籤-->
<label style="color: green" for="userName">姓名:</label><input type="text" id="userName"/>
lable標籤可以使點擊 姓名 時能在文字框內獲得游標
HTML學習筆記