为什么将浮动元素的显示属性称为块级? [英] Why is the display property of floated elements said to be block level?

查看:103
本文介绍了为什么将浮动元素的显示属性称为块级?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么我们说浮动元素的 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.

这篇关于为什么将浮动元素的显示属性称为块级?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆