HTML, Hyper Text Markup Language Hypertext Markup language;
Text: plain characters, such as txt text in window
Hypertext: embed styles, images, audio, videos, links, and more in plain text
The basic structure of html:
<! DOCTYPE html>
<title></title>
<body>
</body>
HTML element type:
(1) Block Elements:
- Each block-level element begins with a new row, and the element that follows will also have another row. (a Block-level element is exclusive to a single row).
- The height, width, row height, and top and bottom margins of an element can be set.
- Element width is not set, it is 100% of the parent container (and the width of the parent element), unless the width is set
(2) inline Elements:
- And the other elements are all on the same line;
- Element height, width, row height, and margins are not set
- The height and width of an element depends on the size of the text or Picture it Contains.
(3) inline Block:
- and other elements on the same line;
- The height, width, row height, and margin of the element can be set
Note: the type of the element can be changed by setting the display Property.
For example:
The differences between the following code and the image reveal the differences between different types of label elements
<! DOCTYPE html> <meta Charset=u "utf-8" > <title></title> <style> strong,em,a,img{ display:block; } h1,h2,p,hr,ul,ol,dl{ display:inline; } </style> <body> <strong> unparalleled </strong><strong> unparalleled </strong> <em> Sea-sky </em><em> Sea-sky </em> <p> Jailbreak </p><p> Jailbreak </p> <a> Blue sky </a><a> Sky White clouds </a> <br><br> <ul><li> through the sky </li></ul><ul><li> through the broken Sky </li></ul> <ol><li> the dark curtains </li></ol><ol><li> the dark curtains </li></ol> <dl> <dt> Computers </dt> <dd> Lenovo </dd> <dd> HP </dd> <dt> Mobile </dt> <dd> Xiaomi </dd> <dd> Apple </dd> </dl> <details> <summary></summary> </details> <details> <summary>123</summary> The ends of the earth are geometric, only for the castle Peak Edge Always. </details> </body> |
Styles not controlled, default display for each label, 1
Figure 1
is the opposite of their display style, 2
Figure 2
The difference between the HTML tag element classification