即使输出正确,也无法找出错误所在

  • 本文关键字:出错 错误 输出 html
  • 更新时间 :
  • 英文 :


我需要在HTML中完全相同地重新创建此图像中的所有内容。我已经这样做了,但它说段落缺失,链接缺失等

要重新创建的图像在这里

到目前为止,我的代码是:

<!DOCTYPE html>
<html>
<head>
<title>This page definitely has a title</title>
</head>
<body>
<font face = "Times New Roman">
<h1> <font size="5">This is some text!A level 1 heading with a tooltip that says 'tooltip' (with the quotes)</h1> </font>
<p><font size="3"><b>This level 3 heading has a link to <a href="https://www.ww3schools.com">https://www.ww3schools.com</a></b></p></font>
<p><font size="3">This is just a regular paragraph.</p>
</font>
</body>
</html>

任何帮助都将不胜感激,谢谢!

您的结束标记似乎放错了位置,

将关闭/h1放在/font 之后

您的第二行应该是h3而不是p,并将您的结束语/h3放在/font 之后

在您的第三行中,将您的结束/p放在/font 之后

希望这能有所帮助!

@JakeBlack是正确的,请接受他的回答。我唯一的额外输入是,通过正确地缩进代码,这样您就可以看到正在封装的代码块,这有助于尽早发现这些问题。也不需要在顶部添加额外的HTML标记。

<!DOCTYPE html>
<head>
<title>This page definitely has a title</title>
</head>
<body>
<font face="Times New Roman">
<h1> 
<font size="5">
This is some text!A level 1 heading with a tooltip that says 'tooltip' (with the quotes) 
</font>
</h1> 
<p>
<font size="3">
<b>
This level 3 heading has a link to <a href="https://www.ww3schools.com">https://www.ww3schools.com</a>
</b>
</font>
</p>
<p>
<font size="3">
This is just a regular paragraph.
</font>
</p>
</font>
</body>
</html>

试试这个

<!DOCTYPE html>
<head>
<title>This page definitely has a title</title>
<style>
body {
font-family: "Times New Roman", Times, serif;
}
</style>
</head>
<body>
<p>This is some text!A level 1 heading with a tooltip that says 'tooltip' (with the quotes)</p>
<p>This level 3 heading has a link to <a href="https://www.ww3schools.com">https://www.ww3schools.com</a></p>
<p>This is just a regular paragraph.</p>
</body>
</html>

相关内容

最新更新