Home > Article > Web Front-end > What are the characteristics of block elements?
The characteristics of the block element are: 1. Always starts on a new line; 2. Height, line height and top and bottom margins can be controlled; 3. The default width is 100% of its container , unless a width is set.
Features of block elements:
1. Exclusively on one line
2. The width, height and inner and outer margins of the element can be Setting
3. If the width is not set, it will be 100% of the parent element
Common block elements are as follows:p div table h1 h2 h3 h4 h5 h6 ul ol li
Features of inline elements:
1. Can be on the same line as other elements
2. Cannot set width and height, cannot set internal and external margins
3. Width is image or text The width cannot be changed
Common inline elements are as follows:span img br input
Recommended tutorial: "css tutorial"
The above is the detailed content of What are the characteristics of block elements?. For more information, please follow other related articles on the PHP Chinese website!