vue 单独页面body css 样式设置

给某个page下template中的第一个div设置如下样式:

.body-bg {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  overflow-y: auto;
  background-color: #000;
}

 

示例:

<template>
  <div class="body-bg">
       //其它内容
  </div>
</template>

css:

<style scoped>
  .body-bg{
    position: absolute;
    height: 100%;
    width: 100%;
    top:0;
    left: 0;
    overflow-y: auto;
    background-color: #fff;//背景色为白色
  }
</style>

这样就可以使当前页面全屏白色了。

posted @ 2019-02-19 09:10  WFaceBoss  阅读(18920)  评论(0编辑  收藏  举报