Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

What is the basic structure of html files?


May 30, 2021 Article blog


Table of contents


The basic structure of HTML files

1, file structure tag

The basic structure of HTML files mainly contains some of the most basic file structure tags. Here's the table:
File structure tag illustrate
<html> <HTML 文档的开始>
<head> <HTML 文档的头部开始>
<title> <HTML 文档的标题信息开始>
</title> <HTML 文档的标题信息结束>
</head> <HTML 文档的头部结束>
<body> <HTML 文档的主体开始>
</body> <HTML 文档的主体结束>
</html> <HTML 文档的结束>
As can be seen from the table above, the most basic structure of HTML files consists mainly of four tags, <html><html> < head <head></head> <title></title> <body></body> their meanings are described as follows:
  • < html >< html > labels define the start and end points of a document, between which is the head and body of the document. The head of the document is defined by <head > label, while the body is defined by the label > < body.
  • <head > label is used to define the head of a document and is a container for all head elements. e lements in < head > can reference scripts, indicate where the browser finds style sheets, provide meta-information, and so on. T he header of the document describes the various properties and information of the document, including the title of the document, its location on the Web, and its relationship to other documents. The vast majority of document headers contain data that is not actually displayed as content to the reader.
  • < title > label is used to define the title information for an HTML file, that is, the text that appears on the title bar of the browser window when the current file is browsing through the browser, which is required in almost all HTML files.
  • < body ></body > as the principal tag of an HTML file, that is, only web objects edited in the tag can be displayed in the browser window, and the tag has multiple tag properties, all of which are essentially page properties used to control the current HTML file

2, code instance

<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/xhtml">
<!--xmlns 属性在XHTML中是必需的,但在 HTML 中不是。不过,即使XHTML文档中的 <html> 没有使用此属性,W3C的验证器也不会报错。
这是因为 "xmlns=http://www.w3.org/1999/xhtml"是一个固定值,
即使您没有包含它,此值也会被添加到<html>标签中-->
  <head>
      <title>HTML文件的基本结构</title>
  </head>
  <body>
  </body>
</html>