html - 固定列、流动内容和底部固定页脚

标签 html css layout

我有一个问题,为了帮助您理解,我做了一个 jsfiddle .

    ________________________________
   |   |                           |
   | F |                           | 
   | I |                           |
   | X |                           |
   | E |                           |
   | D |         CONTENT           |
   |   |                           |
   | B |                           |
   | A |                           |
   | R |                           |
   |   |                           |
   | 3 |___________________________|
   | 0 | FOOTER POSITIONED BOTTOM  |
   |   |    OR DANTE'S INFERNO ?   |
   |___|___________________________|

最佳答案

这是更新后的 Fiddle 解决方案:- http://jsfiddle.net/2C955/40/

我所做的 Css 更改:-

body, html {
    width: 100%;
    height: 100%;
}
#main {
    width: 100%;
    height: 100%;
    display:table;
}
.bar {
    height: 100%;
    width: 100px;
    display:table-cell;
}
.content {
    height: 100%;
    width: 90%;
    display:table-cell;
}
.footer {
    width: 90%;
    position: absolute;
    bottom: 0px;
}

HTML:- 添加了一个 Main Div

<div id="main">
    <div class="bar">Fixed space</div>
    <article class="content">
        <div>here is the content</div>
        <div class="footer">FOOTER NEED TO BE PLACE AT THE BOTTOM...BUT HOW?</div>
     </article>
</div>

希望这对您有所帮助!

关于html - 固定列、流动内容和底部固定页脚,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21491177/

相关文章:

css - 如何用阴影、高光效果和非平面颜色复制这个底部?

javascript - Colorbox 插件仅适用于我首先单击的第一个链接。?

html - 无法拆分行和列的 div

html - 在框中选择标签显示选项

java - 像在 Android 的 Facebook 应用程序中一样创建登录布局

Javascript 弹出窗口 - 需要创建类并将事件绑定(bind)到 document.getElementsByClassName 返回的每个元素

html - 如何调整 Bootstrap 页面标题中的导航栏?

html - 在类内的链接上设置悬停

html - 网站布局在不同的屏幕分辨率下变得凌乱

android - 安卓上的图像映射