HTML5 role attribute for tags(标签的 HTML5 角色属性)
问题描述
我的 HTML5 模板在页面左上角的每个页面(我用于关键字)上都有 h1
元素.
My HTML5 template has h1
elements on every page (that I use for keyword) on top left part of the page.
是否有一个 role
属性可以将它们标记为类似于 WorPress 中的标签的标签?
Is there a role
attribute to sign them as tags like the tags in WorPress?
推荐答案
根据 W3C 的定义,您可以将此值用于 role
属性:
As defined by W3C, you can use this values for role
attribute:
横幅
补充
内容信息
定义
主要
导航
注释
搜索
contentinfo
目的是提供有关内容的元信息,因此可用于标签管理.也就是说,<h1>
不应该用作标签,因为它的主要目的是明确描述整个页面
contentinfo
purpose is to provide meta information about the content, so it could be used for tag management. That said, <h1>
shouldn't be used as tags, as it's main purpose is to explicitly describe the whole page
来源
这篇关于标签的 HTML5 角色属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:标签的 HTML5 角色属性


基础教程推荐
- Electron 将 Node.js 和 Chromium 上下文结合起来意味着 2022-01-01
- 如何使用JIT在顺风css中使用布局变体? 2022-01-01
- 自定义 XMLHttpRequest.prototype.open 2022-01-01
- 如何使用TypeScrip将固定承诺数组中的项设置为可选 2022-01-01
- html表格如何通过更改悬停边框来突出显示列? 2022-01-01
- Chart.js 在线性图表上拖动点 2022-01-01
- Vue 3 – <过渡>渲染不能动画的非元素根节点 2022-01-01
- 直接将值设置为滑块 2022-01-01
- 我可以在浏览器中与Babel一起使用ES模块,而不捆绑我的代码吗? 2022-01-01
- 用于 Twitter 小部件宽度的 HTML/CSS 2022-01-01