css - 绑定(bind)到底部的 div 的最大高度

标签 css html

<body style="width: 100%; text-align: center;">
    <div style="margin: 0 auto;">container
        <div style="width: 200px; margin-top: 100px; float: left;">
            left
        </div>
        <div style="width: 728px; float: left;">
            <div style="height: 100px;">
                1
            </div>
            <div style="height: 150px;">
                2
            </div>
            <div style="margin-bottom: 0; bottom: 0; height: 100%;">
                3
            </div>
        </div>
    </div>
</body>

DIV 1 有固定的高度,

DIV 2 通过 jQuery 改变高度

DIV 3 必须尽可能地拉伸(stretch),在 2 之后向下延伸到 bottom: 0;

3 中缺少哪些样式?

我还希望 container 居中。

最佳答案

这可以在没有 Javascript 的情况下使用 css 表格

FIDDLE

关于css - 绑定(bind)到底部的 div 的最大高度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17466131/

相关文章:

javascript - 我们可以在点击时删除 HTML 元素的边框吗?但保持边界焦点

css - 汉堡菜单不适用于样式化的组件

javascript - HTML 事件处理程序与 React 事件处理程序

html - 为什么 div 中的文本在浏览器中显示在其外部?

javascript - 在 React 中使用 Link Component 时如何摆脱样式

html - 数据库应用程序 html 模板

javascript - 在事件 'mousemove' 和 'scroll' 上显示自定义水平滚动条,然后在两个事件均未触发约 1 秒时隐藏滚动条

php - 如何在 PHP 的新行上打印每个 <td>..</td>?

javascript - 如何在同一位置的下一行中找出td的索引

html - 如何给一半的网页添加喷绘渐变?