一、文本标签
标题标签
是什么?
h 标签
注意事项:
- h1-h6 共有六级 其中一级标签最大
- 是闭合标签
我是一级标签
- 是行间标签
怎么用?
标签名 在标签里面直接写即可
实例 :
<h1>我是一级标签</h1> <--我的等级最大-->
<h2>我是二级标签</h2>
<h3>我是三级标签</h3>
<h4>我是四级标签</h4>
<h5>我是五级标签</h5>
<h6>我是六级标签</h6>
段落标签
是什么?
p标签
注意事项:
- 行间标签
- 闭合标签
- 、、、
实例:
<p> 我是段落标签 </p>
一、常见文本标签:
1 .
标题标签
h
2.段落标签
p
3.粗体
strong
4.斜体
em
5.删除线
del
6.下划线
ins
图片标签
<img src="" alt="" title="" >
音频标签
<audio src="" controls autoply loop>
controls:
进度条控件
autoply: 自动播放
loop: 循环播放
- 视频标签
<vedio src="" controls autoply muted loop>
- controls:控件
- autoply:自动播放
- muted配合autoply使用 静音
- loop:循环播放
- 链接标签
<a href="" target="_self/_blank "></a>
href:放链接的地址 可以是url 文件的路径
self:点击链接后会覆盖原网页
blank:保留原网页,打开新建页
二、常见的列表标签
列表名称 | 标签使用 | 怎么用的 | 注意事项 |
---|---|---|---|
无序列表 | ol 和li | <ol> <li> </li></ol> | |
有序列表 | ul和li | <ul><li></li></ul> | |
自定义列表 | dl和dt和dd | <dl><dt></dt><dd></dd><dl> | dt:列表的主题 dd:列表的内容 都放在dl里面 |
三、表格标签
<table>
caption="" //表格标题
<thead> //表格的头部
<tr> // tr 为行标签
<td></td> // td 为表头单元格 列标签
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td></td>
</tr>
</tbody>
<tfoot>
<tr>
<td></td>
</tr>
<tfoot>
<table>
注意事项
:
- 标签名称有 table thead tr th td tbody tfoot rowspan colspan
- 其中 嵌套关系是 table>thead、tbody、tfoot>tr>th、td
- 在table标签里面可以设置表格的宽和高 width 和height
- rowspan colspan 是合并单元格标签
使用步骤
1. 确定是合并列还是行 列用colspan 行用rowspan
2. 保留左上单元格内容其余删掉
3. 在tr标签中添加相应的合并方式标签
四、表单标签
- input标签
标签名称 | type | 注意事项 |
---|---|---|
单行文本框 | text | placeholder设置提示文字 |
密码框 | password | placeholder设置提示文字 |
单选框 | radio | 同一类别的要设置相同的name属性 通过label标签实现点文字也能选中 checked 实现默认选中 |
复选框 | checkbox | 同单选框 |
提交文件 | file | 通过multiple 可以提交多个文件 |
- 这些标签都要放到input里面
- input 标签要放到 form标签里面
- textarea
- 多行文本框
- 属性有 rols cols
- 选项列表
<select>
<option selected><option> //option为选项 selectd为默认选中
<option></option>
</select>
- 按钮
有两种写法
一:input写法
1, submit 提交标签 reset 重置标签 button 普通按钮
2. 通过valve 属性设置按钮名称
<input type=" submit" valve="提交按钮" >
<input type=" reset">
<input type="button">
二 : button写法
<button type =submit> 提交按钮</button>
<button type ="reset'> 重置按钮</button>
<button type =button> 普通按钮可以用JavaScript为其设置点击行为</button>