vue中<div>不能占满整个屏幕

1. css中设置div的样式position:fixed;及height:100%,width:100%

<template>
  <div class="html body">
</template>

.html{
  background:url('../img/bg.jpg') repeat center top #826e79;
  height: 100%;
  width: 100%;
  position: fixed;
}

2、App.vue中设置body

body {
    margin: 0;
    padding: 0;
  }

 

posted @ 2020-11-18 17:24  世界因你而小  阅读(5824)  评论(0编辑  收藏  举报