HTML Basics - basic formatting

HTML basic format

The basic format of a standard html document is as follows:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

</body>
</html>

<!DOCTYPE html>: This tag function: tell the browser that the following content is the syntax of the html5 specification.

html标签: Includes all the content of html, known as the root element.

head标签: The container of all header elements, which describes various attributes and information of the document, such as: the title of the document, the style sheet referenced by the document, and the JS script file , etc. Most of the data contained in the header of the document will not actually be used as content displayed to the user.

<meta charset="UTF-8">: It is used to set the character set. The character set that the document should use is set to UTF-8, which includes most characters in the written language, and can basically handle any text content placed on the page.

title标签: Set the title of the page, that is, the content that appears in the browser tab, and is also used to describe the title of the page when it is added to bookmarks or favorites.

body标签: Contains all content displayed on the page, such as: text, pictures, videos, games, playable music, etc.

Guess you like

Origin blog.csdn.net/seevc/article/details/131251139