vue 单独页面body css 样式设置

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

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

 

示例:css

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

css:spa

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

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

相关文章
相关标签/搜索