【问题标题】:Can't stick footer to bottom in Vue.js [duplicate]无法在 Vue.js 中将页脚粘贴到底部 [重复]
【发布时间】:2021-05-01 02:37:56
【问题描述】:

我未能将页脚粘贴到底部。 下面是我的 Vue.js 模板:

<template>
  <div id="homeDiv">
    <div class="wrapper">
      <div><SpFrontHeader/></div>
      <div class="content">
        <el-col :span="18">
          <h1>main-content</h1>
        </el-col>
        <el-col :span="6">
          <PriceFrame/>
        </el-col>
      </div>
      
    </div>
    <div class="Footer"><SpFrontFooter/></div>
  </div>

CSS 样式:

<style scoped>
.wrapper{
  min-height: 80%;
  margin-bottom: 20%;
}
content{
  margin-bottom:20%;
}
.footer{
  width:100%;
  position: absolute;
  height: 20%;
}
</style>
</template>

看起来像这样:

顺便说一下,我使用了一些element-ui组件,但没有使用它的Container。 应该怎么做才能修复它?谢了

【问题讨论】:

    标签: css vue.js


    【解决方案1】:

    试试这样:

    .footer{
      width:100%;
      position: fixed;
      height: 20%;
      bottom: 0;
      left: 0;
    }
    

    【讨论】:

    • 这不是把它推到屏幕底部而不是页面吗?还是我错过了什么?
    猜你喜欢
    • 2013-10-27
    • 2014-11-09
    • 2011-01-22
    • 2016-04-12
    • 2010-12-02
    • 2011-10-15
    • 1970-01-01
    相关资源
    最近更新 更多