在此上下文中,元素li不允许作为元素div的子元素

时间:2012-11-07 20:50:32

标签: html html5 validation twitter-bootstrap

我正在使用twiiter bootstrap生成可折叠菜单,并在验证此代码时出错:

<div class="nav-collapse">
  <ul class="nav pull-right">
    <li><a href="/">Home</a></li>
    <li><a href="/outfits">Outfits</a></li>
    <li><a href="/champions">Champiopns</a></li>
    <li><a href="/news">News</a></li>
    <li><a href="/contact">Contact</a></li>
    <li>
      <a href="/users/sign_in">Login</a>  
    </li>
  </ul>
</div>

这是错误:

 Line 73, Column 12: Element li not allowed as child of element div in this context. (Suppressing further errors from this subtree.)
        <li><a href="/">Home</a></li>
Contexts in which element li may be used:
Inside ol elements.
Inside ul elements.
Inside menu elements.
Content model for element div:
Flow content.

我不明白,在我看来,li元素被正确包裹在ul ...

如何验证此代码?

0 个答案:

没有答案