什么是XHTML角色属性?你用它做什么? [英] What is XHTML role attribute? What do you use it for?

查看:112
本文介绍了什么是XHTML角色属性?你用它做什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已阅读 W3C的页面此,但它仍然是模糊的我。是角色属性的目的是澄清code?还是会被一些浏览器或蜘蛛PTED间$ P $?

I have read W3C's page on this, but it is still vague to me. Is the role attribute's purpose to clarify the code? Or will it be interpreted by some browsers or spiders?

它可以被用来作为使用一些JavaScript库(我这样想,因为 ID 属性必须是唯一的一个DOM选择,这可以用来识别多个资源页面上的)?

Can it be used as a DOM selector using some JavaScript libraries (I am thinking so since the id attribute has to be unique, this could be used to identify multiple resources on a page)?

推荐答案

短版:

角色属性可能会给未来的浏览器的方式与设备无关的方式一定XML元素智能化工作。例如,被标记为导航角色属性的无序列表可以是在桌面和手持环境的浏览器智能PTED间$ P $,允许它在两个环境清楚地显示出来。

The Role Attribute may give future browsers a way to work intelligently with certain XML elements in a device-independent way. For example, an unordered list that is marked with the role attribute of "navigation" can be interpreted intelligently on browsers in both desktop and handheld environments, allowing it to be displayed clearly in both environments.

长版本:

在此规范中定义的XHTML角色属性允许作者注释XML语言有关元素的目的机器提取的语义信息。用例包括可访问性,设备适配,服务器端处理和复杂的数据说明。

The XHTML Role Attribute defined in this specification allows the author to annotate XML Languages with machine-extractable semantic information about the purpose of an element. Use cases include accessibility, device adaptation, server-side processing, and complex data description.

的属性描述的作用(多个)当前元素在文档的上下文中播放。这可以用来,例如,由应用程序和辅助技术的确定的元素的目的。这将允许用户作出可采取在元素上的行动和激活了的设备无关的方式的选择的动作明智的决策。它也可以用来作为一种机制用于注释一文件的一部分中一个的域特定的方式的(例如,一个法律术语分类)。

The attribute describes the role(s) the current element plays in the context of the document. This can be used, for example, by applications and assistive technologies to determine the purpose of an element. This could allow a user to make informed decisions on which actions may be taken on an element and activate the selected action in a device independent way. It could also be used as a mechanism for annotating portions of a document in a domain specific way (e.g., a legal term taxonomy).

例如:

<ul role="navigation sitemap">
    <li href="downloads">Downloads</li>
    <li href="docs">Documentation</li>
    <li href="news">News</li>
</ul>

鉴于XHTML2工作组将停止在今年年底存在,有没有这种规范的机会,达到有史以来的任何类似目前的形式发布状态。 http://www.w3.org/News/2009#entry-6601

这篇关于什么是XHTML角色属性?你用它做什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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