https://www.bilibili.com/video/av7288645/index_1.html#page=1
@表严肃
HTML5常用标签
<div></div>
div标签:division 区域,最常见、使用最频繁的标签
<a href=""></a>
a标签:anchor 锚链接;
href标签:Hypertext Reference
<a href="http:www.baidu.com" target="_blank">打开链接</a>
target="_self" 在当前页打开链接(默认);
target="_blank" 在空白页打开链接
<img src="" alt="">
img标签:图片,不是容器,不需要结束标签, 图片链接失效时显示alt里的内容
<table></table>
table标签:表格
- tr:“table row(表格行)”,表示一行的开始和结束。
- td:“table data(表格数据)”,表示行中各个单元格的开始和结束。
- th:“table head(表头)”,表示定义表格内的表头单元格。
- thead:定义表格的表头, 内部必须拥有 <tr> 标签。
- tbody:定义表格主体(正文),内部必须拥有 <tr> 标签。
例如:
<html>
<head>
<style type="text/css">
thead {color:green}
tbody {color:blue;height:50px}
tfoot {color:red}
</style>
</head>
<body>
<table border="1">
<thead>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
</thead>
<tbody>
<tr>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td>February</td>
<td>$80</td>
</tr>
</tbody>
<tfoot>
<tr>
<td>Sum</td>
<td>$180</td>
</tr>
</tfoot>
</table>
</body>
</html>
![](https://img.haomeiwen.com/i416966/8e571ee955d4bc70.jpg)
<header></header>
<footer></footer>
header标签:定义文档的页眉(介绍信息)。
footer标签:定义文档或节的页脚。
便于浏览器检索。
<link rel="stylesheet" type="text/css" href="">
放在head和body都可以,link一般放到head。
<script type="text/javascript"></script>
放在head和body都可以,script放在body比较多,对script依赖不是特别多的时候可以放在body的最后。
<button></button>
button标签:按钮,例如放到表格里提交数据
<form>
username:<input><br>
password:<input><br>
<button>signup</button>
</form>
![](https://img.haomeiwen.com/i416966/68b6483e951c440d.jpg)
<abbr></abbr>
abbr标签:abbreviation 缩写
例如:<abbr title="HyperText Markup Language">HTML</abbr>
鼠标放在HTML上的时候显示HyperText Markup Language
<code></code>
<pre></pre>
code标签:用于表示代码,镶嵌到一行内,可以为其添加样式 <style media = " ">
pre标签:用于表示大段代码,可以为其添加样式 <style media = " ">
网友评论