html5 - 关于img标签 左浮动的问题
高洛峰
高洛峰 2017-04-17 14:31:31
0
4
939

请问一下 为什么img标签加上左浮动之后 它原本在下面的东西就能跑到img的右边去呢?

我记得p1和p2,假如把p1加上左浮动的时候,那这时不是应该是p1覆盖了一部分p2的吗?求高手解答一下 谢谢!

这和标签什么默认属性有关系的吗 ?

高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

reply all(4)
黄舟

MDN Documentation

W3C Document

Maybe float was originally set to achieve text wrapping effect

伊谢尔伦

Text elements and inline elements will be placed around floating elements, while block-level elements will fill the gaps before floating elements. I don’t know the specific reason why

阿神

Add overflow:hidden;

to the outer parent element
迷茫

Two block elements are arranged from top to bottom. One floats to the left and the other naturally floats over

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