html - 哪些情况下float会失效?
PHPz
PHPz 2017-04-17 11:12:56
0
6
1211

比较p没有设宽度或高度的时候,float是否会失效。
还有哪些情况会失效的?

PHPz
PHPz

学习是最好的投资!

reply all(6)
阿神

Hello! When p has no width or height, and there are no width-height elements or text content in it, the p will not be displayed, but float will still take effect.

Failure situation: Two ps at the same level, the first one is set with float:left, and the second one is not set, the first one will be out of the document flow, which means that the second p ignores the existence of the first one. Will overlap

PHPzhong

What do you mean by failure?

大家讲道理

Currently we only know that float does not take effect when absolute positioning and display is none. I hope other experts can answer the questions

Ty80

Properties not affecting flexible boxes

Because flexible boxes use a different layout algorithm, some
properties do not make sense on a flex container:

  • column-* properties of the multiple column module have no effect on a flex item.

  • float and clear have no effect on a flex item. Using float causes the display property of the element to compute to block.

  • vertical-align has no effect on the alignment of flex items.

小葫芦

Invalid when using absolute positioning

左手右手慢动作

Display:flex will also fail, you can use margin-left:auto to solve it

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template