为什么将浮动元素的显示属性称为块级?

为什么将浮动元素的显示属性称为块级?

问题描述:

为什么我们说浮动元素的 display 属性可能会更改为块级,而不是说 inline-block ,因为它开始根据包装的内容占用空间?

Why do we say that the display property of floated elements may change to block level, instead of saying inline-block, because it starts taking the space according to the content it wraps?

inline-block表示内联级别,即块容器

inline-block means inline level, block container.

行内元素参与一行(或多行)的布局。这会影响行距和同一行中其他元素的垂直对齐。

inline-level elements participate in the layout of a line (or multiple lines). This affects line spacing and the vertical alignment of other elements in the same line.

浮动元素不执行任何操作。参与块格式化上下文,而不是内联格式化上下文。

Floated elements do none of that. The participate in block formatting contexts, not inline formatting contexts.