如何处理浮动元素? [英] How to deal with floated elements?

查看:64
本文介绍了如何处理浮动元素?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果父元素中有浮动元素,则这些父元素的形状会变松或没有高度。

If there are floated elements in a parent element, they parent element looses its shape or has no height. How to deal with this problem?

谢谢

推荐答案

解决方案为此,请使用 clearfix 类。

The solution to that is using clearfix class.

这篇关于如何处理浮动元素?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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