Files
ClassContent/历届学生/front-end-team/每天课程/2022-03-08/笔记.txt
2024-09-27 02:06:13 +08:00

16 lines
319 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

浮动 float
作用 把块元素放一行
父元素的宽高 被内部子元素 撑开 的
当 子元素设置浮动后子元素漂浮走了所以父元素内部其实没有子元素所以高度为0
如何解决:
1可以给父元素手动设置高度
2overflow: hidden;