【发布时间】:2021-09-09 00:42:18
【问题描述】:
我正在使用 HTML 嵌套列表在我的网站上创建目录。在进行 Chrome Lighthouse 审核时,我发现辅助功能存在问题。
上面写着“列表不仅仅包含 <li> 元素和脚本支持元素”
我的列表包含另一个列表(嵌套)所以它是问题的原因?
我的每个列表项也包含<a>,我该如何使用我的代码来解决 chrome 警告。
<div class="TOCContainer Collapsable">
<ul class="parent start">
<li><a class="TOCLink" href="#1">Why do Big Companies Die?</a></li>
<li><a class="TOCLink" href="#2">How did Apple become the Most Innovative Company in the world?</a></li>
<li><a class="TOCLink" href="#3">What Made Apple So innovative?</a></li>
<li><a class="TOCLink" href="#4">Is Apple still innovating in 2021?</a></li>
<ol class="continue">
<li><a class="TOC-link" href="#5">The Slow Improvement in Existing Products</a></li>
<li><a class="TOCLink" href="#6">Lack of Industry Disrupting New Products</a></li>
<li><a class="TOCLink" href="#7">The perception of Apple Being only concerned of Profits</a></li>
</ol>
<li><a href="#8">The Silver Lining</a></li><li><a class="TOCLink" href="#9">Conclusion</a></li>
</ul>
</div>
【问题讨论】:
标签: html wordpress google-chrome html-lists lighthouse