Body Tag 主体标签

The body tag <body> is used for creating the main body, or content area of a website. This element represents the main section of the website where almost all of the visible elements of a design are located. Since most content displayed on a typical web-page is contained within the opening and closing body tags <body> the start (or opening) tag is usual closer to the top of the document while end (or closing) tag is located near the bottom section of code.

<body>标签用于创建网站的主体或内容区域。此元素表示网站的主要部分,几乎所有可见的设计元素都位于该部分。由于典型网页上显示的大多数内容都包含在开始和结束正文标签中,因此开始(或开始)标签通常更靠近文档顶部,而结束(或结束)标签位于代码底部附近。

The body of a website is categorized as a “sectioning root”, and the elements contained within the body are categorized as “flow content”.

网站的主体被分类为“分段根”,主体中包含的元素被分类为“流内容”。

Note: HTML documents can only have one body tag <body> element.

注意:HTML文档只能有一个<body> 标签元素。

Syntax 语法:

The body tag is written as <body>   </body> with the document’s content inserted between the start and end tags.

主体标记写为<body>   </body>,文档内容插入开始标记和结束标签之间。

The body tag <body> is located after the head tag <head>, and should always be the second HTML element in a document.

body标记位于head标记之后,并且应该始终是文档中的第二个HTML元素。

Example 例:

Instructions: Retype this code in an HTML editor and then load the webpage in a browser of your choice. Then once you have loaded the page try experimenting with the code. Making a few small changes and then preview how those changes affected your webpage. Once you are comfortable with this HTML Tag you should proceed to the next example.

This example demonstrates how body tag <body> appears within an HTML document. Notice that none of the content outside of the body tag <body> appear as a visible element in the design of the page in this example.

此示例演示了body标签如何显示在HTML文档中。请注意,在本例中,body标签之外的任何内容都不会在页面设计中显示为可见元素。

Proceed to the next example: Heading Tags