Ensure lists are structured correctly

Screen readers depend upon lists being structured properly, to keep users informed of content within the lists. The only content lists should contain should be within <li> elements. They can also contain script supporting elements (<script> and <template>). Lighthouse reports when lists contain any other content elements that shouldn't be within the lists:

Lighthouse audit showing lists contain content elements that shouldn't be within the lists
  <figcaption class= Lists contain content elements that shouldn't be within the lists.

How to fix this problem

To fix this problem, remove any elements in lists that don't belong there. Ordered and unordered lists must only contain <li>, <script> or <template> elements.

Valid lists must have parent elements (ul or ol elements) and child elements (li elements). Any other content elements are invalid. Learn more in <ul> and <ol> must only directly contain <li>, <script> or <template> elements.

More information

Last updated: Improve article