Vue CSS “Always on the bottom” Footer

32 阅读1分钟

App.vue

<style>
html,
body,
#app {
  margin: 0 0;
  padding: 0 0;
}

html {
  height: 100%;
  box-sizing: border-box;
}

*,
*:before,
*:after {
  box-sizing: inherit;
}

body {
  position: relative;
  min-height: 100%;
  border:1px solid #ffffff;
}

</style>

footer element

<template>
<p class="footer">
  ©2019 xxxxxx有限公司
</p>
</template>
<style scoped>
.footer {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  text-align: center;
  color: #7a7a7a;
  font-size: 12px;
}
</style>