css - 嵌套的 div 同样长

标签 css layout html

<div id = "content">

<div id="column1"> </div>
<div id ="column2"> </div>

</div>

我有一个问题,我希望 column1 和 column2 是内容 div 的大小(因此每列与最大列一样长)。但我尝试将每列的高度设置为自动或 100%,希望它会占用空间,但两者仍然采用自己的大小。

我该怎么做? (不能仅使用表格 css)enter image description here

在此示例中,第 1 列需要变得更长(与第 2 列一样长)

最佳答案

好吧,这在某种程度上取决于您的目的。我猜这是一个背景问题,在这种情况下,可以使用“人造列”轻松解决。

在这里阅读更多相关信息:http://line25.com/articles/create-sidebars-of-equal-height-with-faux-columns

关于css - 嵌套的 div 同样长,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6562522/

相关文章:

javascript - 使用 Angular Formly 时,表单提交中不包含空字段

html - 在 html 和 css 中将选项卡右对齐

html - 使用显示: inline-block; HTML CSS时出现添加框

html - 使两个div并排出现

javascript - 使用 GWT,如何加载图像并访问图像属性和 http 状态代码

html - Mac 和 Windows 之间 <span> 中的字体定位差异

css - IE7图形问题

css - 如何缩小 Google 字体 CSS

html - 我无法更改我的页面背景(基础 5)

html - div 不与图像重叠