确定。我获得了编程训练营的前期作业,以便在不使用CSS的情况下设置简单的传记。我们还必须使用我做过的html验证器。现在我无法弄清楚错误的含义。我把我的名字作为表格标题,我在colspan里面使用了h2标签,所以我可以把名字做得更大。验证器说错了,但它在浏览器中显示正常,我不知道如何为验证器修复它。所以这里是代码的snipet与问题。 (第16行是表格边界线18是tr边界,第20行是colspan。)
<!DOCTYPE html>
<html lang ="en">
<head>
<meta charset ="utf-8">
<title>Levi's Biography</title>
<!-- lines 6 through 11 are simply added for developing the page to a future standard -->
<link rel="stylesheet" type="text/css" href="mybio.css">
<script src="/jquery.js"></script>
<script type="text/javascript" src="/js/jquery-1.3.1.js"></script>
</head>
<body>
<table border="4px">
<thead>
<tr border="3px">
<!-- html validator says lines 16, 18, and 20 are wrong even though browser shows up well. How do i fix this? -->
<th colspan="4"><h2>Levi Donaldson</h2></th>
</tr>
</thead>
<tbody>
<tr>
<td style="font-family:copperplate"><h3>Born</h3></td>
<td style="font-family:copperplate"><h3>Grew up</h3></td>
<td style="font-family:copperplate"><h3>Hobbies</h3></td>
<td style="font-family:copperplate"><h3>Foods</h3></td>
</tr>
<tr>
<td>Moenci, AZ</td>
<td>Mesa, AZ
<br>
Wasilla, AK
<br>
Eagar, AZ
<br>
Cliff, NM
</td>
<td>Quality family time
<br>
Traveling
<br>
Fishing
<br>
Cooking
<br>
Passive income streams
<br>
Creating things or improving their designs
</td>
<td>A great steak
<br>
Sushi <em>(with scallops if possible)</em>
<br>
Brazilian rice and beans
<br>
Home grown fruit
<br>
Fresh garden veggies and herbs
<br> Cheesecake <strong>(but for heavens sake, NO New York style)</strong>
</td>
</tr>
</tbody>
</table>
<img src="http://1.bp.blogspot.com/_b3dSgzaqFKs/SRfDqJxbSOI/AAAAAAAAADc/iNvyqMQqzKs/S220/katie%26levi2+001.jpg" alt="levi wedding" />
</body>
</html>
答案 0 :(得分:0)
因为您已将<!DOCTYPE html>
放在文档的顶部,验证程序将使用HTML 5规则对其进行验证。
在HTML 5中,border属性不再有效。您必须使用css,例如style='border: 1px solid black'
。
border
代码没有TR
属性。所以它无效。
您不应在H2
标记内使用TH
标记。请改用css。例如:style='font-size: 200%;'
。