HTML html 标签

htmlweb developmentfront end technology更新于 2025/6/28 20:28:17

HTML 中的 <html> 标签是 HTML 页面或文档的根,被视为所有其他 HTML 元素的容器。

现在让我们看一个实现 <html> 标签的示例 −

示例

<!DOCTYPE html>
<html>
<head>
<title>Document Title comes here</title>
</head>
<body>
<h1>
   Heading comes here
</h1>
   Content comes here
</body>
</html>

输出

在上面的例子中,我们首先设置了 doctype −

<!DOCTYPE html>

之后,使用 <html> 标签来设置其中的其他元素,包括 <head> −

<html>
<head>
<title>Document Title comes here</title>
</head>

现在使用 <body> 标签来设置内容 −

<body>
<h1>

Heading comes here
</h1>
Content comes here

<body> 标签已关闭,HTML 文档最终以结束标签结束 −

</body>
</html>

相关文章


有用资源