0

我正在尝试通过 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>
4

1 回答 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>
于 2013-10-12T22:36:55.350 回答