Hello world!
Sectioning elements
HTML5 included the addition of the following content sectioning elements, which inherit default landmark roles:Landmark roles
Therole
attribute is used to define an element's role on a page. When sectioning elements were introduced, the role
attribute became used less for landmarking. This is because roles were applied by default to most sectioning elements, therefore, they were more widely used and accepted for their simplicity.
The role
attribute is not only used for assigning roles to content sections. The attribute can also be used to assign roles to many other elements, although it is used less nowadays due to new semantic HTML elements.
Examples
Misuse
Following the addition of sectioning elements in HTML5, there was confusion regarding whether role attributes were needed for sectioning elements. It is in fact redundant to give sectioning elements the role attribute. Additionally, you should not try to alter sectioning elements' default roles.{{Cite web , title=Using ARIA , url=https://www.w3.org/TR/using-aria/Overview.html , access-date=2022-03-13 , website=www.w3.orgExamples of misuse
The role ofmain
on the
element is useless, as it already inherits that role as its default landmark role:Hello world!
form
role to
is semantically improper, because it overrides
's the default role of banner
:See also
* Semantic Web * Semantic HTML * Web accessibility *References