Front-end -- about HTML, -- HTML
Before talking about HTML, you have to give a rough description of the relationship between the browser and HTML. As we all know, a browser is an application that can call networks and display received html documents. Strictly speaking, the HTML document is a string written according to a certain rule (the same in any language). This string is <! Documents starting with
The official name of HTML is hypertext markup language, which transmits two messages: 1. HTML is a language; 2. HTML can mark non-text content.
Since HTML is a language, it must have something similar to a compiler that performs lexical analysis, syntax analysis, and semantic analysis. This job is done by a browser. Therefore, HTML also has syntax. Its syntax is very simple and generally includes the following six rules:
1. The label should be written in angle brackets <>;
2. The tag is closed (either the end is/or the end is </> );
3. tags can have multiple attributes, such as id and class;
4. labels can be nested, such as <div> <p> </div>;
5. The comment is written as <! -- Xxxxx -->;
6. The characters are case-insensitive;
Based on the above rules, you can write the correct HTML code.
For non-text content, HTML documents can contain images, audios, videos, programs, and other non-text content, which can be marked by specific tags. For example, img, object, script, video, and audio. The non-text content is displayed to the user in its own unique form.
Therefore, I understand three types of labels: 1. you can provide the default style. Of course, this can be rewritten. For example, <strong> the default style is bold; 2. it can provide default functions, such as a tag and select tag; 3. you can divide different semantic regions, such as nav and aside;