自动拉伸垂直列(div) [英] Auto stretching vertical columns (divs)

查看:243
本文介绍了自动拉伸垂直列(div)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请检查此小提琴

我想要以下:红色列有一些文本,黄色是动态内容,绿色没有什么,只是一种颜色。我想要红色和绿色列的高度作为黄色内容。 height:100% did not work

I want the following: the red column has some text, the yellow is the dynamic content, the green has nothing, just a color. I want both red and green columns to be as height as the yellow content. height: 100% didnt work

推荐答案

实现结果

You can use negative margins to achieve the result

浮动div应该被包装在一个带溢出的容器中:hidden
这是 fiddle a>
这是代码

The floating divs should be wrapped in a container with overflow:hidden This is the fiddle This is the code

#container {
    overflow:hidden;
}

#container div {
    padding-bottom:2000px;
    margin-bottom:-2000px;
}

这篇关于自动拉伸垂直列(div)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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