HTML 是用來(lái)描述網(wǎng)頁(yè)的一種語(yǔ)言。
HTML 指的是超文本標(biāo)記語(yǔ)言 (Hyper Text Markup Language);
HTML 不是一種編程語(yǔ)言,而是一種標(biāo)記語(yǔ)言 (markup language);
標(biāo)記語(yǔ)言是一套標(biāo)記標(biāo)簽 (markup tag);
HTML 使用標(biāo)記標(biāo)簽來(lái)描述網(wǎng)頁(yè);
<DOCTYPE html> 聲明文檔類型
<head></head> 網(wǎng)頁(yè)頭部
<meat /> 針對(duì)搜索引擎和更新頻度的描述和關(guān)鍵詞
<base target="" /> 為頁(yè)面上的所有鏈接規(guī)定默認(rèn)地址或默認(rèn)目標(biāo) _blank:新標(biāo)簽頁(yè)打開(kāi)/_self:當(dāng)前標(biāo)簽頁(yè)打開(kāi)
<style></style> 定義文本樣式
<link rel="stylesheet" type="text/css" href="css_file_path" /> 引入css文件
<title></title> 網(wǎng)頁(yè)標(biāo)題
<body></body> 網(wǎng)頁(yè)身體
<header></header> 定義 section 或 page 的頁(yè)眉
<footer></footer> 定義頁(yè)腳
<article></article> 定義文章內(nèi)容
<aside></aside> 定義側(cè)邊欄
<section></section> 定義小片段
<h1></h1> .... <h6></h6> 標(biāo)題1-6
<p></p> 段落
<br /> 換行
<hr /> 水平線
<strong></strong> <b></b> 粗體
<em></em> <i></i> 斜體
<ins></ins> 下劃線
<del></del> 刪除線
空格
< <小于號(hào)
> >大于號(hào)
© 版權(quán)符號(hào)
<div></div> 盒子標(biāo)簽
<span></span> 盒子標(biāo)簽
超鏈接
<a href="url" target="">鏈接</a>
圖片
<img src="圖片地址" alt="不顯示圖片時(shí)顯示的內(nèi)容" title="鼠標(biāo)懸停時(shí)顯示的內(nèi)容" />
無(wú)序列表
<ul> 定義無(wú)序列表
<li></li> 定義列表的項(xiàng)目
</ul>
有序列表
<ol> 定義有序列表
<li></li>
</ol>
自定義列表
<tr> 定義表格中的行
<td></td> 定義表格中的單元
<dd></dd> 定義定義列表中項(xiàng)目的描述
</tr>
表格
<table border="1" cellspacing="0" cellpadding="5">
border:規(guī)定表格邊框的寬度
cellpadding:規(guī)定單元邊沿與其內(nèi)容之間的空白
cellspacing:規(guī)定單元格之間的空白
<thead> 定義表格中的表頭內(nèi)容
<th></th> 定義表格中的表頭單元格
</thead>
<tbody> 定義表格中的主體內(nèi)容
<tr> 定義表格中的行
<td></td> 定義表格中的單元
</tr>
</tbody>
</table>
input標(biāo)簽
<input type="text" placeholder="文本提示內(nèi)容" /> 文本框
<input type="password" /> 密碼提示框
<input type="url" autofocus /> url輸入框 聚焦
<input type="search" required /> 搜索框 required必填項(xiàng)
<input type="email" /> 郵件輸入框
<input type="tel" autocomplete /> 手機(jī)號(hào)輸入框 輸入框記憶配合submit
<input type="file" multiple /> multiple多文件上傳使用
<input type="date" /> 年月日
<input type="month" /> 年月
<input type="week" /> 年周
<input type="button" /> 按鈕
<input type="submit" /> 提交按鈕
<input type="reset" /> 重置按鈕
<input type="radio" /> 復(fù)選框
<input type="checkbox" checked /> 單選框 checked默認(rèn)選中
<input type="image" src="path" /> 圖片按鈕
select下拉列表
<form action="" method="" > action資源路徑 method請(qǐng)求方法
<select> 定義選擇列表
<option>1</option> 定義選擇列表中的選項(xiàng)
<option selected="selected">2</option> selected默認(rèn)第一項(xiàng)
</select>
</form>
datalist(HTML5)下拉列表
<input type="text" list="lis" />
<datalist id="lis"> 需要使用 list id 進(jìn)行關(guān)聯(lián)
<option></option>
<option></option>
</datalist>
label標(biāo)簽
<label for="la">內(nèi)容</label>
<input type="text" id="la" /> 需要for id 進(jìn)行關(guān)聯(lián)
filedset與legend標(biāo)簽
<filedset>
<legend>定義filedset標(biāo)題</legend>
</filedset>
audio與video標(biāo)簽
<audio autoplay loop controls>
<source src="音頻文件地址" />
</audio>
<video autoplay loop controls>
<source src="視頻文件地址" />
</video>
autoplay:自動(dòng)播放
loop:循環(huán)次數(shù)
contorls:顯示播放控件