Home  >  Article  >  Web Front-end  >  What are the characteristics of block elements?

What are the characteristics of block elements?

hzc
hzcOriginal
2020-06-28 11:30:533703browse

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.

What are the characteristics of block elements?

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn