2013-10-12 192 views
0

我想通過W3C驗證(這是我的第一個HTML網頁設計類)。我一直得到相同的錯誤(文本不允許在元素ul在這種情況下。)。有五個這些錯誤,他們都在相同的位置,但在不同的線路上。無法通過W3C驗證

如果有人可以請看看這個,告訴我我做錯了什麼。謝謝。

<!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:[email protected]">[email protected]</a> 
</i></small> 
</div> 
</body> 
</html> 
+0

它看起來像你在這裏使用這個工具,但我不能確信這一點。 http://validator.w3.org/#validate_by_input+with_options –

回答

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>