css - VueJS Bootstrap CSS 如何在页面底部放置元素?

标签 css vue.js vuejs2 bootstrap-4

enter image description here

我想将我的页脚(版权声明)放在页面下方。但它在页脚下方添加了一些额外的空白。我如何删除这个额外的空白区域

我正在做这个 VueJS 元素。这是我的代码。

App.vue

<template>
  <div class="fluid-container">
    <app-header></app-header>
    <div style="min-height:610px;">

      <router-view></router-view>

    </div>

<div>
  <app-footer></app-footer>
</div>

  </div>
</template>

footer.vue

<template>
  <div class="fluid-container">
    <p class="text-center">Copyright &copy 2018, ABC Marketing. All Rights Reserved.</p>
  </div>
</template>
<script></script>
<style scoped>
div{
  color: white;
  background-color: #003459;

}
</style>

最佳答案

我认为在 footer.vue 中你将版权文本包装在 p 标签中,根据 bootstrap 4 p 标签有 margin-bottom: 1rem; 如果你删除了 margin-bottom 它将固定在底部页面的。

.fluid-container.footer{
  background: blue;
}
.fluid-container.footer > *:last-child {
    margin-bottom: 0px;
    color: #fff;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0/css/bootstrap.css" rel="stylesheet"/>
<div style="min-height:610px;">
</div>

<div>
  <div class="fluid-container footer">
    <p class="text-center">Copyright &copy; 2018, ABC Marketing. All Rights Reserved.</p>
  </div>
</div>

</div>

关于css - VueJS Bootstrap CSS 如何在页面底部放置元素?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49605136/

相关文章:

vue.js - 从方法中只调用一个方法

javascript - 使用没有 Id 和标记名的 javascript 更改 DIV 文本

css - 在 asp.net 中限制输入控件宽度

css3 slider 自动旋转

css - 在 tinymce 编辑器中更改所选文本的样式(不是蓝色背景突出显示)

javascript - Vue watcher 在绑定(bind)新数据之前执行?

javascript - Vue.js v-if 不重新渲染

vue.js - 在 Vue JS 中使用 v-for 发送组件的 props

vue.js - 为vuejs创建消息通知时如何避免代码重复

vue.js - Vue路由器中的确切路径匹配?