<!DOCTYPE HTML> //代表H5格式
<html lang = "zh" dir = "ltr"> //lang代表語言 dir代表擺放方向
<head>
<title>Document<title> //網(wǎng)頁名
<link rel = "stylesheet" href = "./....css"> //引入的樣式表
<link rel = "Icon" href? = "./....png/icon"> //引入的網(wǎng)頁圖標(biāo)
<meta charset="utf-8"> //設(shè)置網(wǎng)頁的編碼格式
<meta name="viewport" content="width=device-width, initial-scale=1"> // 這個(gè)屬性只對(duì)移動(dòng)設(shè)有用冯勉,配合使用media
<meta name="robots" content="noindex, nofollow"> // 搜索協(xié)議, index,可以爬取這個(gè)網(wǎng)頁啊研,follow援雇,可以爬取跟蹤這個(gè)網(wǎng)站上的其他鏈接扬虚,noindex nofollow 不允許蟋恬。
</head>
<script defer src = ".../.js"></script> //使用defer異步加載js文件璃岳,且在$(document).DOMContentLoaded事件之后運(yùn)行铸鹰。
<script defer src = ".../.js"></script> //使用defer加載的js文件都按寫入順序加載癌别。
<body>
<h1 - h6 ></>標(biāo)題
<p></> 段落,塊元素display:block
<q></> quote 行引用蹋笼,result : "this is quote"
<blockquote></> 塊引用
<br/> 換行標(biāo)識(shí)符展姐,跟'\n'一樣的效果,用于行內(nèi)元素?fù)Q行
<pre></> 不清除里面的多余空格和換行
<ol>/<ul>/<dl> order list, unorder list, defined list
<li>/<dt>&<dd> li : list用于ol剖毯,ul圾笨,dt defined title , dd defined data
<img src/> 圖片
<figure>~><figcaption> ~><img> figcaption :標(biāo)題
<div></div> 塊容器
<span></span> 行容器
<strong></> 粗體強(qiáng)調(diào)
<a href name target download="filename" >? a里面也可以是其他元素,比如img逊谋。name="[#]xxx"訪問擂达,download設(shè)置下載文件名&href必須是文件
<table cellspacing cellpadding> 表格, cellsapcing在css中設(shè)置最好。
<th>/<td> table heading 表格頭部胶滋,table data 表格數(shù)據(jù)
<form action method></> 表單
<fieldset> <legend> input集合板鬓, 標(biāo)題悲敷。
<input type = " " name = " "> 下面是常用type:
text : 文本輸入 placeholder, input事件
password :密碼輸入
radio/checkbox : 單選框 和 復(fù)選框俭令,以name區(qū)分后德,設(shè)置了value返回value,checked = "checked"抄腔,不然返回HtmlContent瓢湃,change事件
file : 文件選擇,?accept 赫蛇,event.target.files 返回File或Blob對(duì)象绵患。change事件。
submit : 觸發(fā)form commit
reset : 重置表單數(shù)據(jù)悟耘,根據(jù)form屬性
image : 圖形submit
button : 普通按鈕藏雏,click事件
通用屬性:
readonly 只讀屬性
disabled 禁用屬性,不會(huì)添加到查詢字符串中
tabindex 只能從1開始作煌,tabindex添加focus和blur事件
autofocus 自動(dòng)獲取焦點(diǎn)
?form : 需要在form中填寫id掘殴,指定form的id,實(shí)現(xiàn)input不用存放在form之中就可以使用form提交數(shù)據(jù)
<select name> <optgroups> <option value selected> 下拉控件
<textarea name> resize : none, 去掉下面的三角形
<iframe src = "" name = ""> 內(nèi)嵌框架粟誓,name在form的target中可以使用奏寨。
</body>