Hongmeng Novice Team

What does DOCTYPE do?

What does DOCTYPE do? How to distinguish between standard mode and promiscuous mode? What do they mean?
/1. The <!DOCTYPE> declaration is called a document type definition (DTD), and the purpose of the declaration is to tell the browser the type of the document. Let the browser parser know which specification should be used to parse the document. The <!DOCTYPE> declaration must be in the first line of the HTML document, this is not an HTML tag;

How to distinguish between standard mode and promiscuous mode? What do they mean?

/2. HTML5 has no DTD, so there is no difference between strict mode and promiscuous mode. HTML5 has a relatively loose syntax. When implemented, it has achieved backward compatibility as much as possible. (HTML5 has no distinction between strict and miscellaneous);
/3. Standard mode [also known as standard mode, means that browsers parse code according to W3C standards],
/4. Promiscuous mode [also known as weird mode or compatibility mode, which refers to browser use Parse the code in your own way].

What is the difference between inline elements and block-level elements?

/1. Block level: The block level element will occupy a line by default, the width automatically fills the width of its parent element by default
[similar to flex-flow: row wrap; part of the function, after extending to the width of the parent element, it will automatically wrap. Or automatically wrap when insufficient];
 Inline: Inline elements will not occupy a line alone, and adjacent inline elements will be arranged in the same line. Its width varies with the content.
 [Similar to flex-flow: row nowrap; part of the function, no upper limit of Width, without external force, similar to the ball on the physics department doing uniform linear motion without external force];
/2. Block level: block level elements can be Set width and height [Extensibility]
 Inline: Inline elements cannot set width and height [No extensibility]
/3. Block level: Block level elements can set margin, padding Inline
 : horizontal margin-left; margin-right; padding-left; padding-right; can take effect.
 But the vertical [margin-bottom; margin-top; padding-top; padding-bottom] cannot take effect.
/4. Block-level css attribute declaration: display: block; [Set the current element as a block-level element]
 Inline css attribute declaration: display: inline; [Set the current element as an inline element]
[Modify the display attribute to switch block-level elements And inline elements]

HTML5 document type and character set?
/1. <!doctype html> [document type] ;! Doctype html
/2. [Encoding format] UTF-8 [The case is the same, uppercase is recommended]
If you follow the [html suggested code specification], the attributes are all lowercase Good; if it is better to use uppercase for the name given in [Character Set Encoding Specification], I suggest using uppercase here.

Guess you like

Origin blog.csdn.net/qq_43784821/article/details/102775502