HTML Checking for Large Sites
Rocket Validator automatically checks your pages on the W3C Validator.
HTML issues tagged as li.
Due to an issue in the W3C validator, this is identified as an error but it’s not. This issue has been notified, and we’ll update our validator as soon as there’s a fix.
According to the WAI-ARIA 1.2 spec:
The aria-setsize property defines the number of items in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.
Authors MUST set the value of aria-setsize to an integer equal to the number of items in the set. If the total number of items is unknown, authors SHOULD set the value of aria-setsize to -1.
A <li>
element, used to define a list item, does not accept the button
role.
This HTML code is invalid because the <li>
elements can’t have role="button"
:
<ul>
<li role="button">One</li>
<li role="button">Two</li>
</ul>
Learn more:
A closing tag </li>
has been found, but there were open elements nested inside the <li>
. You need to close the nested elements before you close the <li>
.
A closing tag </li>
has been found, but there were open elements nested inside the <li>
. You need to close the nested elements before you close the <li>
.
For example:
<li>
<span>example
</li>
The above is invalid because you need to close the <span>
tag before you close the <li>
.
This would be valid:
<li>
<span>example</span>
</li>
A <li>
element is used to define an item of a list, so adding the listitem
role to it is redundant.
The ARIA listitem
role can be used to identify an item inside a list of items. It is normally used in conjunction with the list
role, which is used to identify a list container.
<section role="list">
<div role="listitem">List item 1</div>
<div role="listitem">List item 2</div>
<div role="listitem">List item 3</div>
</section>
When possible, you should use the appropriate semantic HTML elements to mark up a list and its list items — <ul>
or <ol>
, and <li>
. For example:
<ul>
<li>List item 1</li>
<li>List item 2</li>
<li>List item 3</li>
</ul>
Read more:
Still checking your large sites one page at a time?
Save time using our automated web checker. Let our crawler check your web pages on the W3C Validator.