HTML body tag

 The HTML body tag is the main part of the web content. Most of the content of the web page, such as text, pictures , videos , forms , tables , etc., are written in the body tag. Each independent web page can only have one set of body tags , The browser will automatically distinguish the body tag from other tags such as head , title , meta, link..., and recognize the content of the body before displaying it on the screen, so we can see many pictures and texts on the computer For web content, all major browsers support the HTML body tag function.


HTML body tag example
<html>
<head>
<title>Webpage title</title>
</head>

<body>
 ...Webpage content...
</body>

</html>
HTML body tag starts with <body> and ends with </body>. The initial <body> tag can use the default attributes to modify the text color, hyperlink color, background color or background image in the web page And other information, but these information is not supported in HTML5, the next paragraph will mention CSS replacement methods. The standard <body> tag must be after the </head> tag and before the </html> tag. As shown in the example, if it exceeds the scope, it will cause some browsers to display errors or even fail to display web content.

Evolve from HTML 4.01 to HTML 5.

The <body> tag before HTML 4.0 has many attributes that can be used. For example, text is used to set the text color of the body tag content, link is used to set the hyperlink text color of the content contained in the body tag , alink used to set the hyperlink is pressed color, vlink set visited hyperlink color, bgcolor to set the background color, background is used to set a page background image, but in the beginning of these attributes become HTML4.01 not recommended, Even in HTML5, these attributes are not directly supported and replaced by CSS styles.

All attributes related to the text or hyperlink color in the HTML body tag , such as link, alink, vlink, etc., can be replaced with CSS syntax. Please refer to the introduction of " Modifying Hyperlink Color " and " CSS color Text Color ". The web page background color bgcolor property is changed to CSS syntax, please refer to "background-color " introduction. For background background images, please refer to the introduction of background-image " to use CSS syntax . In the future, HTML5 or newer versions will become the mainstream. It is recommended to follow the mainstream design method.

Post a Comment

0 Comments