html
html速查
百度说了:超文本标记语言(标准通用标记语言下的一个应用,外语缩写HTML),是迄今为止网络上应用最为广泛的语言,也是构成网页文档的主要语言。HTML文本是由HTML命令组成的描述性文本,HTML命令可以说明文字、图形、动画、声音、表格、链接等。HTML的结构包括头部(Head)、主体(Body)两大部分,其中头部描述浏览器所需的信息,而主体则包含所要说明的具体内容。
头部
- <title>
- <title>text</title> 页名,关键抓取
- <meta/>
- <meta name="keywords" content=""/> //内容是关键字
- <meta name="description" content=""/> //关键字和描述不会影响搜索引擎排名
- <meta name="author" content=""/>
- <meta charset="utf-8"/>
- <meta http-equiv="refresh" content="3;url=http:i.cnblogs.com"/> //重定向
标题
- <h1>~<h6>
- <hr /> 水平分割线size=1宽
- h1搜索引擎仅次于title重要性
段落
- <p></p>
- <br />换行<nobr>不推荐</nobr>
样式
- <link rel="stylesheet" type="text/css" href="cssName.css">
格式化
- <pre></pre>保持格式
- <sub></sub>下标字
- <sup></sup>上标字
注释
- <!-- text -->
链接
- <a href="https://www.cnblogs.com/liqunblog/"></a>链接超链接 //href="#"回到顶部
- <a id="mark">text</name> <a href="#mark"></a>链接特定 //id或者name都可
- target="_blank"
- <a href="mailto:邮箱">联系</a> //邮箱
图像
- <img src="/images/picture.jpg" />
- alt="text"无法载入时的内容
- ../../返回上面目录
表格
- <table></table>.表格
- <tr></tr>表格行
- <td></td>行中列
- <th></th>表头,替代行中列的位置
- <thead><tbody><tfooter>长表格时(打印表格式,可随意换序,浏览器tbody会自动添加上)
- <caption>text</caption>定义表格的标题
- 占位符
- colspan="2" rowspan="3" 横方向占2 列方向占3
列表
- <ul></ul>表(有序是<ol>)
- <li></li>项
- 自定义列表dl dt dd
语义元素H5(块级)
- <header>定义文档或节的页眉
- <nav>定义导航栏
- <section>定义文档中的节
- <article>定义独立的自包含文章
- <aside>定义内容之外的侧栏等
- <footer>定义页脚
框架
- <frameset>分页(禁用)
- <iframe src="">内嵌
字符实体
- &nsbp; 空格
- <小于号
- >大于号
表单
- <form></form>外套层
- <input type = "text" name = "inputName" value = "value">文本
- <input type = "password" name = "inputName" value = "value">密码
- <input type = "radio" name = "inputName" value = "value" checked>单选(name相同的组成一组) type = "checkbox"复选 type = "button"按钮等等
<input type = "radio" name = "inputName" value = "value"> - <input type = "submit">
-
<form action = "demo/form.asp" method = "post"> action指定交付处 <input type = "text" name = "inputName" value = "value"> value设定默认值 <input type = "submit"> </form> inputName = value
<select name = "name"> 下拉列表
<option value = "1" selected>一</option>
<option value = "2">二</option>
<option value = "3">三</option>
<optgroup label="分类名"></optgroup>//可以进行分类 -
</select>
- <textarea name = "name" rows = "10" cols = "15">text</textarea> 多行输入
- <button type = "button" onclick = "alert('你好,世界')">点击</button>
- <label for="idInput">用户名</label><input id="idInput" ...><input> //直接跳转
- <fieldset>为表单进行分组
音频
- <audio controls = "controls">
<source src = "/mp3.mp3" type = "audio/mp3" />
<source src = "/mp3.ogg" type = "audio/ogg" />
</audio>
视频
- <video>
<source src = "/movie.mp4" type = "video/mp4" />
<source src = "/movie.ogg" type = "video/ogg" />
<source src = "/movie.webm" type = "video/webm" />
</video>
实体(转义)
-
html转义需要特殊字符
- 小于<
- 大于>
- 空格 (no break apace)
- 版权符©
推荐参考手册
html空格都被视为一个