无法通过W3C验证

时间:2013-10-12 22:27:09

标签: w3c-validation

我正在尝试通过W3C验证(这是我的第一个HTML网页设计课程)。我一直收到相同的错误( 在此上下文中元素ul中不允许使用文本。 )。这些错误中有五个,它们都位于相同的位置,但位于不同的位置。

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

<!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 个答案:

答案 0 :(得分: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>