无效的ul& HTML中的li标签

时间:2015-09-17 01:59:57

标签: html

我正在尝试使用HTML进行this练习。有5个测试用例,其中一个给我带来了麻烦。我已经尝试了一切,但我仍然无法弄清楚问题。我只是无法通过“列表和图片”。测试用例。谁能帮我?

我们需要修复以下HTML代码中的错误。

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Company page</title>
  </head>
  <body>
    <paragraph>Welcome! Here you can find following things:</paragraph>
    <ol>
      <em><li><a href="#logo">Company's logo</a></li></em>
      <li><a href="#employees">List of employees</a></li>
    </ol>

    <h2>Company's logo
    <paragraph>Company uses following logos:</paragraph>
    <ul>
      <li><img src="new_logo.gif">New logo</img></li>
      <li><img src="old_logo.gif">Old logo</img></li>
    </ul>

    <h2>List of employees
    <thead>
      <th>First name</th>
      <th>Last name</th>
    </thead>
    <table>
      <tr>
        <td>Mary</td>
        <td>Williams</td>
      </tr>
      <tr>
        <td>James</td>
        <td>Smith</td>
      </tr>
    </table>
  </body>
</html>

这是我的回答

<html>
<head>
    <meta charset="utf-8">
    <title>Company page</title>
</head>

<body>
<p>Welcome! Here you can find following things:</p>
<ol>
    <li><a href="#logo">Company's logo</a></li>
    <li><a href="#employees">List of employees</a></li>
</ol>

<h2>Company's logo</h2>

<p>Company uses following logos:</p>

<ol>
    <li><img src="new_logo.gif" alt="new logo">New logo</li>
    <li><img src="old_logo.gif" alt="old logo">Old logo</li>
</ol>

<h2>List of employees</h2>

<table>
    <thead>
    <th>First name</th>
    <th>Last name</th>
    </thead>
    <tr>
        <td>Mary</td>
        <td>Williams</td>
    </tr>
    <tr>
        <td>James</td>
        <td>Smith</td>
    </tr>
</table>
</body>
</html>

1 个答案:

答案 0 :(得分:1)

  1. 您错过了doctype。
  2. 你扔掉了em标签。我想 你应该只是移动它们。
  3. 您将ul更改为ol
  4. 另外,thtd类似 - 它必须位于tr内。