【问题标题】:CSS positioning footer and distance between header tagsCSS 定位页脚和页眉标签之间的距离
【发布时间】:2016-11-30 13:17:27
【问题描述】:

即使我的内容较少,如何将页脚始终保持在底部? 减少两个标题标签之间的距离?
这是指向 html 和 css https://jsbin.com/guwugaloci/edit?html,css,output 的链接
imghttps://s31.postimg.org/hzkef0257/image.jpg
问题显示在图像和页脚中。

【问题讨论】:

  • 欢迎使用 StackOverflow,请适当地包含您的代码并查看 How to Ask 以提高您的问题的质量。

标签: html css position footer


【解决方案1】:

尝试绝对定位页脚

.footer{
    position: absolute;
    bottom: 0;
}

【讨论】:

    【解决方案2】:

    header{
      height:84px;
    }
    section{
      height:100%;
    }
    
    footer{
      height:84px;
      position:absolute;
      bottom:0;
     }
    <header>
      Header
    </header>
    <section>
      Content
    <footer>
      Footer
    </footer>

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-04-05
      • 1970-01-01
      • 2017-09-25
      • 2012-07-07
      • 2012-02-26
      相关资源
      最近更新 更多