defines the rows in the table
2. Then let’s take a look at the difference between inline elements and block-level elements:
1. The intuitive difference between inline elements and block-level elements
Inline elements will be arranged in a straight line, all on the same line, arranged horizontally
Block-level elements each occupy one line, arranged vertically . Block-level elements start on a new line and end with a line break.
2. Block-level elements can contain inline elements and block-level elements. Inline elements cannot contain block-level elements.
3. The difference between the attributes of inline elements and block-level elements is mainly due to the box model attributes.
The width and height settings for inline elements are invalid, (line-height can be set), and the margin up and down are invalid. padding is invalid up and down
3. Conversion of inline elements and block-level elements:
Convert block-level elements into inline elements: display:inline;
Convert inline elements into Block-level elements: display:block;
Inline block elements: display:inline-block;
The above is the detailed content of Summary of inline elements and block-level elements in html. 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