2012-09-26 108 views
0

我仍然是一個新手,我有點混淆這個錯誤的含義。w3驗證html錯誤

Line 30, Column 5: document type does not allow element "li" here; missing one of "ul", "ol" start-tag 

我得到這個錯誤一路直到行44

這種省略是什麼意思?

Line 54, Column 7: end tag for "div" omitted, but OMITTAG NO was specified 
下面

是我的代碼:(感謝如果有人能指導我

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en" > 
<head> 
    <meta http-equiv="content-type" content="text/html; charset=utf-8" /> 
    <meta name="description" content= "about" /> 
    <meta name="keywords" content="about" /> 
<title>About</title> 
</head> 
    <body> 
     <div id="container"> 
     <div id="inside"> 
     <div id="inside2"> 
     <h1>About</h1> 
     <ul> 
     <li>The Php version installed in mercury is <?php echo 'Current PHP version: ' . phpversion(); ?>. 
     </li> 
     <br /> 
     <li>The task I am not attempted is Task 5. 
     </li> 
     <br /> 
     <li>I am not exploring and implementing any special feature.</li> 
     <br /> 
     <li>I have trouble mainly on Task 3 with validation.</li> 
     <br /> 
     <li>Regarding with php, I want to gain more knowledge, I need to grasp deeper understanding on how everything works 
     as there are a lot of things to remember and how things are working. The other part is I need to dramatically improve 
     my time managment, although I start a week and half early, but I had trouble understanding the codes, and with other 
     assignments I need to finish.</li> 
     <br /> 
     <li>Youtube channel by the name phpacademy and thenewboston help me out to get clearer understanding about certain stuff 
     in php, as well stackoverflow.com</li> 
     <li>I have learn more and new codes, better understanding on how overall the code works in PHP, but still a lot to learn.</li> 
     <br /> 
     <img src="thread.jpg" width="450" height="350" alt="Discussion Thread" /> 
     <br /> 
     <a href="index.php">Return to Homepage</a> 


     <ul> 


    </body> 
    </html> 

回答

0

對於第一條消息,任何<li> s必須是一個<ul>的孩子對於第二個消息,你開三<div>。 s,但從不關閉它們,<br />也無效且多餘; <li>會自動斷線。您的HTML可以修改爲如下所示:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en" > 
<head> 
    <meta http-equiv="content-type" content="text/html; charset=utf-8" /> 
    <meta name="description" content= "about" /> 
    <meta name="keywords" content="about" /> 
<title>About</title> 
</head> 
<body> 
    <div id="container"> 
    <div id="inside"> 
    <div id="inside2"> 
    <h1>About</h1> 
    <ul> 
    <li>The Php version installed in mercury is <?php echo 'Current PHP version: ' . phpversion(); ?>. 
    </li> 
    <li>The task I am not attempted is Task 5.</li> 
    <li>I am not exploring and implementing any special feature.</li> 
    <li>I have trouble mainly on Task 3 with validation.</li> 
    <li>Regarding with php, I want to gain more knowledge, I need to grasp deeper understanding on how everything works 
    as there are a lot of things to remember and how things are working. The other part is I need to dramatically improve 
    my time managment, although I start a week and half early, but I had trouble understanding the codes, and with other 
    assignments I need to finish.</li> 
    <li>Youtube channel by the name phpacademy and thenewboston help me out to get clearer understanding about certain stuff 
    in php, as well stackoverflow.com</li> 
    <li>I have learn more and new codes, better understanding on how overall the code works in PHP, but still a lot to learn.</li> 
    <li> 
     <img src="thread.jpg" width="450" height="350" alt="Discussion Thread" /> 
     <a href="index.php">Return to Homepage</a> 
    </li> 
    </ul> 
</div> 
</div> 
</div> 
</body> 
</html> 
+0

唉唉OK OK,但我想每個這些div,

後結束div突然我得到了另外3誤差出於某種原因 –

+0

@TylerMatema什麼是那些錯誤? –

0

嘗試在您的最後</li>之後放置一個</ul>。然後關閉你的最後<div></div> ...我敢肯定,應該做的伎倆。所有的休息都是不好的格式,你可以使用CSS來改變這些樣式,並且它會更適合瀏覽器。

0

檢查底部的結束ul標籤。 它似乎是<ul>,應該是</ul>(你有一個開始標籤而不是結束標籤)。

記住XHTML 1.0 Strict意味着...嚴格。

1

您的<br/>標籤正在拋棄驗證。刪除它們,或者至少將它們放在適當的元素內。對於其他錯誤,請正確關閉標籤。

0

這應該會更好。

有兩個開放<ul>標籤,沒有一個結束標記,3 </div>的人失蹤,不少<br>'S B/W <li>的。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en" > 
<head> 
    <meta http-equiv="content-type" content="text/html; charset=utf-8" /> 
    <meta name="description" content= "about" /> 
    <meta name="keywords" content="about" /> 
<title>About</title> 
</head> 
    <body> 
     <div id="container"> 
      <div id="inside"> 
      <div id="inside2"> 
      <h1>About</h1> 
      <ul> 
       <li>The Php version installed in mercury is <?php echo 'Current PHP version: ' . phpversion(); ?>.</li> 
       <li>The task I am not attempted is Task 5.</li> 
       <li>I am not exploring and implementing any special feature.</li> 
       <li>I have trouble mainly on Task 3 with validation.</li> 
       <li>Regarding with php, I want to gain more knowledge, I need to grasp deeper understanding on how everything works 
       as there are a lot of things to remember and how things are working. The other part is I need to dramatically improve 
       my time managment, although I start a week and half early, but I had trouble understanding the codes, and with other 
       assignments I need to finish.</li> 
       <li>Youtube channel by the name phpacademy and thenewboston help me out to get clearer understanding about certain stuff 
       in php, as well stackoverflow.com</li> 
       <li>I have learn more and new codes, better understanding on how overall the code works in PHP, but still a lot to learn.</li> 
      </ul> 
      <img src="thread.jpg" width="450" height="350" alt="Discussion Thread" /> 
      <br> 
      <a href="index.php">Return to Homepage</a>  
      </div> 
      </div> 
     </div> 
</body> 
</html>