0

我还是一个新手,我对这个错误的含义有点困惑。

 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>
4

5 回答 5

1

您的<br/>标签正在取消验证。删除它们,或者至少将它们放在适当的元素中。对于其他错误,请正确关闭您的标签。

于 2012-09-26T00:52:36.067 回答
0

对于第一条消息,任何<li>s 都必须是 a 的子级<ul>。对于第二条消息,您打开三个<div>s 但从不关闭它们。<br />s 也是无效和多余的;<li>s 将自动换行。您的 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>
于 2012-09-26T00:50:06.283 回答
0

尝试在你的最后一个之后放置一个</ul>之前</li><div>然后用...关闭你的最后一个</div>。我很确定这应该可以解决问题。此外,所有中断都是错误的格式,您可以使用 CSS 更改这些样式,并且它会更兼容浏览器。

于 2012-09-26T00:51:12.463 回答
0

检查底部的结束 ul 标签。它似乎是<ul>并且应该是</ul>(你有一个开始标签而不是结束标签)。

请记住 XHTML 1.0 Strict 的意思就是……严格。

于 2012-09-26T00:52:09.093 回答
0

这应该更好地验证。

有两个开放<ul>标签,没有一个结束标签,</div>缺少 3 和很多<br>'sb/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>
于 2012-09-26T00:58:48.840 回答