由于外层还有一个div,所以设置背景色100%的时候不能全部都被背景色覆盖。
如果给HTML设置背景色还会影响到其他页面的背景色。
解决方法:
给style添加一个scoped表示当前样式只给当前页面设置。
单独设置背景的方法是在单独页面外层添加一个div,将这个div属性设为:fixed,例如:
<style scoped>
.homeBox {
position: fixed;
width: 100%;
height: 100%;
top: 0px;
background-color: #ffffff;
}
</style>