目录
1.标题
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<h1>1级标题</h1>
<h2>2级标题</h2>
<h3>3级标题</h3>
<h4>4级标题</h4>
<h5>5级标题</h5>
<h6>6级标题</h6>
</body>
</html>
运行结果:
2.段落
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<p>哔哩哔哩 <br> (NASDAQ:BILI;HKEX:9626),英文名称:bilibili,简称B站,现为中国年轻世代高度聚集的文化社区和视频平台,该网站于2009年6月26日创建,被粉丝们亲切地称为“B站”。2018年3月28日,哔哩哔哩在美国纳斯达克上市。2021年3月29日,哔哩哔哩正式在</p>
<hr>
<p>北京时间2021年11月17日,哔哩哔哩公布了截至2021年9月30日的第三季度未经审计的财务报告。财报显示,B站三季度营收达52.1亿元人民币,同比增长61%,各项社区运营数据再创新高。 [243] 2022年2月,bilibili直播将上线开播前人脸认证功能,确保开播人与实名认证者一致,后续逐步在各个分区开放</p>
</body>
</html>
运行结果:
3.文本格式化标签(加粗,下划线,删除线,倾斜)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<b>加粗</b>
<strong>加粗</strong>
<hr>
<u>下划线</u>
<ins>下划线</ins>
<hr>
<i>倾斜</i>
<em>倾斜</em>
<hr>
<s>删除线</s>
<del>删除线</del>
</body>
</html>
运行结果:
4.图片
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<img src = "./cuteboy.jpg" alt="这是个小男孩" title="鼠标悬停在图片的时候显示">
<img src = "./cuteboy.jpg" alt="这是个小男孩" title="鼠标悬停在图片的时候显示" width="200">
<img src="./cuteboy.jpg" width="200" height="300">
</body>
</html>
运行结果:
5.音频标签
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<audio src="./11.mp3" controls autoplay loop></audio>
<audio src="./11.mp3" controls ></audio>
</body>
</html>
运行结果:
6.视频标签
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<video src="./VID.mp4" controls autoplay muted loop></video>
</body>
</html>
7.链接标签
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<a href="https://www.baidu.com">跳转到百度</a>
<br>
<a href="./01标题.html">去0101标题.html</a>
<hr>
<a href="https://www.baidu.com" target="_blank">跳转到百度(新页面)</a>
</body>
</html>
运行结果:
8.列表无序
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<ul>
<li>榴莲</li>
<li>香蕉</li>
<li>苹果</li>
</ul>
</body>
</html>
运行结果:
9.列表有序
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<ol>
<li>zhangsan:100</li>
<li>lisi:80</li>
<li>wanger:20</li>
</ol>
</body>
</html>
运行结果:
10列表自定义
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<dl>
<dt>购物中心</dt>
<dd>账户管理</dd>
<dd>购物指南</dd>
</dl>
</body>
</html>
运行结果:
11.表格
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<table border="2" width="300" height="200">
<tr>
<td>姓名</td>
<td>成绩</td>
<td>评语</td>
</tr>
<tr>
<td>小哥哥</td>
<td>100分</td>
<td>帅</td>
</tr>
<tr>
<td>小姐姐</td>
<td>90分</td>
<td>漂亮</td>
</tr>
</table>
</body>
</html>
12.表格的标题表头
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<table border="1">
<caption><strong>表头标题</strong></caption>
<tr>
<th>姓名</th>
<th>成绩</th>
<th>评语</th>
</tr>
<tr>
<td>小哥哥</td>
<td>100分</td>
<td>帅</td>
</tr>
<tr>
<td>小姐姐</td>
<td>90分</td>
<td>漂亮</td>
</tr>
</table>
</body>
</html>
运行结果:
13.表格结构
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<table border="1">
<caption><strong>表头标题</strong></caption>
<thead>
<tr>
<th>姓名</th>
<th>成绩</th>
<th>评语</th>
</tr>
</thead>
<tbody>
<tr>
<td>小哥哥</td>
<td>100分</td>
<td>帅</td>
</tr>
<tr>
<td>小姐姐</td>
<td>90分</td>
<td>漂亮</td>
</tr>
</tbody>
<tfoot>
<tr>
<td>总结</td>
<td>优秀</td>
<td>优秀</td>
</tr>
</tfoot>
</table>
</body>
</html>
运行结果:
14.表格合并单元格
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<table border="1">
<caption><strong>表头标题</strong></caption>
<thead>
<tr>
<th>姓名</th>
<th>成绩</th>
<th>评语</th>
</tr>
</thead>
<tbody>
<tr>
<td >小哥哥</td>
<td rowspan="2">100分</td>
<td>帅</td>
</tr>
<tr>
<td>小姐姐</td>
<!-- <td>90分</td> -->
<td>漂亮</td>
</tr>
</tbody>
<tfoot>
<tr>
<td>总结</td>
<td colspan="2">优秀</td>
<!-- <td>优秀</td> -->
</tr>
</tfoot>
</table>
</body>
</html>
运行结果:
15.表单input基本使用
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=, initial-scale=1.0">
<title>Document</title>
</head>
<body>
文本框:<input type="text">
<br>
密码框:<input type="password">
<br>
单选框:<input type="radio">
<br>
多选框:<input type="checkbox" name="" id="">
<br>
上传文件:<input type="file" name="" id="">
</body>
</html>
运行结果:
16.表单input占位符
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<input type="text" placeholder="请输入用户名">
<input type="password" placeholder="请输入密码">
</body>
</html>
运行结果:
17.表单input单选框
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<!-- checked默认选中 -->
性别:<input type="radio" name="sex"> 男
<input type="radio"name="sex"> 女
<hr>
性别:
<input type="radio" name="sex"> 男
<input type="radio"name="sex" checked> 女
<hr>
<input type="checkbox" checked>
</body>
</html>
运行结果:
18.表单input上传文件
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<input type="file">
<hr>
<!-- 批量上传文件 -->
<input type="file" multiple>
</body>
</html>
运行结果:
19.表单input按钮
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<form action="">
用户名:<input type="text">
<br>
<br>
密码:<input type="password">
<hr>
<!-- 按钮 -->
<input type="submit">
<input type="submit" value="免费注册">
<input type="reset">
<input type="button" value="普通按钮">
</form>
</body>
</html>
运行结果:
20.表单button按钮
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<button type="submit"> 提交按钮 </button>
<button type="reset"> 重置按钮 </button>
<button type="button">普通按钮</button>
</body>
</html>
运行结果:
21.表单-下拉菜单
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<select name="" id="">
<option value="">北京</option>
<option value="">上海</option>
<option value="">深圳</option>
<option value="">重庆</option>
</select>
<select name="" id="">
<option value="">北京</option>
<option value="">上海</option>
<option value="">深圳</option>
<option value="" selected>重庆</option>
</select>
</body>
</html>
运行结果:
22.表单-文本域
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<textarea name="" id="" cols="30" rows="10">
</textarea>
</body>
</html>
运行结果:
23.表单-label标签
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
性别:
<input type="radio" name="sex" id="nan"> <label for="nan">男</label>
<input type="radio"name="sex" id="nv"> <label for="nv">女</label>
<hr>
<label ><input type="radio" name="sex" >男 </label>
<label ><input type="radio"name="sex" id="nv">女 </label>
</body>
</html>
24.没有语义的标签
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
普通文字
<div>这是div标签1</div>
<div>这是div标签2</div>
<span>这是span标签1</span>
<span>这是span标签2</span>
</body>
</html>
运行结果:
25.字符实体
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<!-- 网页不认识多个空格,只认识一个 -->
这是html文档,我在 学习。
这是html文档,我在 学习。
这是html文档,我在 学习。
</body>
</html>
运行结果: