请问一下 为什么img标签加上左浮动之后 它原本在下面的东西就能跑到img的右边去呢?
我记得p1和p2,假如把p1加上左浮动的时候,那这时不是应该是p1覆盖了一部分p2的吗?求高手解答一下 谢谢!
这和标签什么默认属性有关系的吗 ?
拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...
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;
Two block elements are arranged from top to bottom. One floats to the left and the other naturally floats over
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 elementTwo block elements are arranged from top to bottom. One floats to the left and the other naturally floats over