标签的HTML5角色属性 [英] HTML5 role attribute for tags

查看:94
本文介绍了标签的HTML5角色属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的HTML5模板在页面左上角的每个页面上都有 h1 元素(用于关键字)。

是否有一个角色属性将它们标记为WorPress中的标记之类的标记?

解决方案

根据W3C的定义,您可以使用角色属性的值:




  • banner
  • 互补

  • contentinfo

  • 定义

  • 主要

  • 导航

  • 笔记

  • 搜索



contentinfo 目的是提供元信息关于内容,所以它可以用于标签管理。也就是说,< h1> 不应该被用作标签,因为它的主要目的是明确描述整个页面



来源


My HTML5 template has h1 elements on every page (that I use for keyword) on top left part of the page.

Is there a role attribute to sign them as tags like the tags in WorPress?

解决方案

As defined by W3C, you can use this values for role attribute:

  • banner
  • complementary
  • contentinfo
  • definition
  • main
  • navigation
  • note
  • search

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

Source

这篇关于标签的HTML5角色属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆