In HTML elements, the element will have the display attribute. The display attribute defaults to block, so the element is block-level. The display attribute defaults to inline, so the element is inline. The display default for no elements is inline-block. The display attribute value can be set, for example, to inline for the block-level div element, so it becomes an inline element and no longer displays independently.
- Block, block
- Inline: inline
- Inline block level: inline-block
- Block-level elements have a single row. You can set width, height, padding, and margin. The interior can contain block-level and inline elements.
- Inline elements and other inline peers are displayed. You cannot set width, height, padding, or margin. The interior can contain block-level or inline elements. When the interior contains a block-level element, the block-level element continues to be displayed alone, and the next inline element is displayed on a newline.
- Inline block cascade and other inline lines are displayed. Width, height, margin, and padding can be set as block elements. The interior can contain block-level elements or inline elements. If the interior contains a block-level element, the block-level element will be displayed independently inside the inline element without affecting the display of the next inline element.