Common inline elements + common block elements + empty elements + conversion between elements

1. Common inline elements

span img input button a(hyperlink) strong etc.

2. Common block elements

div   p   h1~h6   ul   li   footer   header 等 

 3. Inline block elements

The img tag can also be regarded as an inline block element. It does not occupy an exclusive line and can also set the width and height.

 4. Empty elements

An element with no content is called an empty element.

br hr (horizontal line) etc.

5. Conversion problem between elements

display:inline converts an element into an inline element ---> does not occupy an exclusive line, and the width and height cannot be set

display:inline-block converts an element into an inline block element ---> does not occupy an exclusive line, you can set the width and height

display:block converts an element into a block element --->occupies an exclusive line and can set the width and height

Guess you like

Origin blog.csdn.net/weixin_47075145/article/details/126531031