HTML web design: First, the basic structure of HTML

Basic structure of HTML


1. The composition of HTML documents

The HTML document is mainly composed of 3 parts.
●HTML part: The HTML part starts with the <html> tag and ends with the </html> tag. The <html> tag is used to tell the browser that the content between these two tags is an HTML document.
●Head: The head starts with the <head> tag and ends with the </head> tag. This part contains the title displayed in the title bar of the web page and other information that is not displayed on the web page. The title is contained between the <title> and </title> tags.
●Main part: The main part contains the text, images and links displayed on the web page. The body part starts with the <body> tag and ends with the </body> tag.

2. The basic structure of an HTML is as follows:

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>一个简单的HTML网页</title>
</head>

<body>
</body>
</html>

       The first line is the document declaration, the second line <html> tag and the last line</html> define the whole html document, the <head> tag and <body> tag are its first-level child elements, inside the <head> tag Responsible for setting the webpage and defining the title. The settings include defining the encoding format of the webpage, external CSS style files and Javascript files, etc. The content of the settings will not be displayed on the webpage, and the content of the title will be displayed in the title bar, <body> Write the content displayed on the web page within.
       An html file is a web page. When the html file is opened with an editor, the text is displayed. You can edit it in the form of text. If you open it with a browser, the browser will render the file into a web page according to the label description.
       The webpage of the above code is displayed as:

Our title section

Guess you like

Origin blog.csdn.net/xfjssaw/article/details/114952221