html5里边caption是什么意思
时间:2022-02-11 17:22
html5里边caption的意思是“表格标题”,caption标签用于给表格元素添加标题,语法为“<caption>表格标题</caption>”;caption标签必须直接放置到table标签之后,且每个表格只能定义一个标题。 本教程操作环境:windows10系统、HTML5版、Dell G3电脑。 html5里边caption是什么意思 <caption> 标签定义表格的标题。<caption> 标签必须直接放置到 <table> 标签之后。 您只能对每个表格定义一个标题。通常标题会居中显示在表格上方。 提示:通常这个标题会被居中于表格之上。然而,CSS 属性 "text-align" 和 "caption-side" 能用来设置标题的对齐方式和显示位置。 语法如下: 示例如下: 输出结果: 推荐教程:《html视频教程》 以上就是html5里边caption是什么意思的详细内容,更多请关注gxlsystem.com其它相关文章!<table><caption>表格标题</caption></table>
<html>
<head>
<meta charset="utf-8">
<title>菜鸟教程(runoob.com)</title>
</head>
<body>
<table border="1">
<caption>表格标题</caption>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td>February</td>
<td>$50</td>
</tr>
</table>
</body>
</html>