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.  
    width: 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.  
    width: 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>

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM