css 一张背景图铺满整个页面 html

1.body{

backgroung:ure(./ing/picture.png)   

backgroung-size:100% 100%;

background-repeart:no-repeart;

background-attachment:fixed;

overflow:auto;

}

vue中

  1. <div id="home"></div>
    css: <style>
    #home {
  2.  
    100%;
  3.  
    height: 100%;
  4.  
    background: url("~@/images/home/h_bg.png") center center no-repeat;
  5.  
    background-size: 100% 100%;
  6.  
    position: fixed;//固定定位
  7.  
    }
  8.  

背景全屏,内容完全显示且可滚动查看  

  1.  
    <div id="home"></div>
  2.  
     
  3.  
    css:
  4.  
    <style>
  5.  
    #home {
  6.  
    100%;
  7.  
    height: 100%;
  8.  
    background: url("~@/images/home/h_bg.png") center center no-repeat;
  9.  
    background-size: 100% 100%;
  10.  
    position:absolute;//绝对定位
  11.  
    }
  12.  
    </style>
原文地址:https://www.cnblogs.com/maibao666/p/14388431.html