All HTML elements are part of block and inline.
The block element is characterized by:
(1) always start on a new line;
(2) Height, row height and top and bottom margin can be controlled;
(3) The width default is 100% of its container, unless a width is set
<div>, <p>,
Conversely, the inline element is characterized by:
(1) and other elements are on one line;
(2) High, row height and top and bottom margin can not be changed;
(3) Width is the width of the text or picture, and it cannot be changed.
<span>, <a>, <label>, <input>, , <strong> and <em> are examples of inline elements.
This feature of an element can be changed with the Display:inline or Display:block command. When do I need to change this attribute?
Let an inline element start from the new line;
Keep The block elements and other elements on one line;
Controls the width of the inline element (especially useful for navigation bars);
Controls the height of the inline element;
Set the background color of a block element to the width of the text without having to set a width