如何使div在高度上增长,同时浮在内部 [英] How to make a div grow in height while having floats inside

查看:161
本文介绍了如何使div在高度上增长,同时浮在内部的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使div在其内部浮动时增加其高度?我知道定义一个值的宽度和设置溢出到隐藏的工作。问题是,我需要一个div与溢出可见。任何想法?

How can I make a div grow its height when it has floats inside of it? I know that defining a value for the width and setting overflow to hidden works. The problem is that I need a div with the overflow visible. Any ideas?

推荐答案

overflow:auto; 一切内部(甚至浮动的项目)可见和外部div完全包围他们。请参见此示例

overflow:auto; on the containing div makes everything inside of it (even floated items) visible and the outer div fully wraps around them. See this example.

这篇关于如何使div在高度上增长,同时浮在内部的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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