Is role recommended to use in my html5 markup or? And why should I use it if the answer is yes.

Thank you.

有帮助吗?

解决方案

Roles are pragmas, designed to provide information directly to accessibility technologies, rather than using HTML5 semantics. In the cases where the same information can be conveyed by either via native HTML or via the role attribute, for example <nav> versus role='navigation', the native semantics should be used. This is generally the case for landmark roles. For other roles, using them can help users with disabilities get the most from your content, so they may benefit from it to the same extent as everyone else.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top