HTML <td> 标签的 abbr 属性 详解
HTML基础 2023-07-13 19:12:27小码哥的IT人生shichen
HTML <td> 标签的 abbr 属性
实例
在 HTML 表格中使用 abbr 属性:
<table border="1">
<tr>
<th>Company</th>
<th>Country</th>
</tr>
<tr>
<td abbr="IBM">International Business Machine</td>
<td>USA</td>
</tr>
<tr>
<td abbr="ICBC">Industrial and Commercial Bank of China</td>
<td>PRC</td>
</tr>
</table>
完整实例【亲自试一试】:
<html>
<body>
<table border="1">
<tr>
<th>Company</th>
<th>Country</th>
</tr>
<tr>
<td abbr="IBM">International Business Machine</td>
<td>USA</td>
</tr>
<tr>
<td abbr="ICBC">Industrial and Commercial Bank of China</td>
<td>PRC</td>
</tr>
</table>
</body>
</html>
可以使用本站在线JavaScript测试工具测试上述代码运行效果:http://www.phpcodeweb.com/runjs.html
定义和用法
abbr 属性规定单元格中内容的缩写版本。
abbr 属性不会在普通的 web 浏览器中造成任何视觉效果方面的变化。
屏幕阅读器可以利用该属性。
浏览器支持
由于在普通的 web 浏览器中不会造成任何视觉效果方面的变化,因此很难说是否存在对 abbr 属性的支持。
语法
<td abbr="value">
属性值
值 | 描述 |
---|---|
text | 单元格的短描述。 |