首页 文章

无法通过W3C验证

提问于
浏览
0

我试图通过W3C验证(这是我的第一个HTML网页设计类) . 我一直得到同样的错误( Text not allowed in element ul in this context. ) . 这些错误中有五个,它们都在同一个位置但在不同的行上 .

如果有人可以请看这个并告诉我我做错了什么 . 谢谢 .

<!DOCTYPE html>
<html lang="en">
<head>
<title>Fish Creek Animal Hospital Services</title>
<meta charset="utf-8">
</head>
<body>
<h1>Fish Creek Animal Hospital</h1>
<div><b><a href="index.html">Home &nbsp;</a>
<a href="services.html">Services &nbsp;</a>
<a href="askvet.html">Ask the Vet &nbsp;</a>
<a href="contact.html">Contact &nbsp;</a></b></div>
<ul>
<li><strong>Medical Services</strong></li>
We offer state of the art equipment and technology.
<li><strong>Surgical Services</strong></li>
Full range of surgical procedures including orthopedics and emergency surgeries.
<li><strong>Dental Care</strong></li>
A dental exam can determine whether your pet needs preventative dental care such as scaling and polishing.
<li><strong>House Calls</strong></li>
The elderly, physically challenged, and multiple pet households often find our in-home veterinary service helpful and convenient.
<li><strong>Emergencies</strong></li>
At least one of our doctors is on call every day and night.
</ul>
<div>
<small><i>Copyright &copy; 2013 Fish Creek Animal Hospital
<a href="mailto:csigman1@gmail.com">csigman1@gmail.com</a>
</i></small>
</div>
</body>
</html>

1 回答

  • 2

    任何包含文本但尚未包装在HTML标记中的部分都会导致此错误 . 在这里,它是列表 . 列表中的每个项目(文本块)都需要包含整个内容的 <li> 标记 .

    <ul>
     <li>text content</li> <!-- correct -->
     <li></li>text content <!-- incorrect -->
    </ul>
    

    因此,在您的脚本中,更改此项中的所有项目:

    <li>
      <strong>Surgical Services</strong></li>
      Full range of surgical procedures including orthopedics 
      and emergency surgeries.
    

    对此:

    <li>
      <strong>Surgical Services</strong>
      Full range of surgical procedures including orthopedics 
      and emergency surgeries.
    </li>
    

相关问题