前言:小刘经常自写项目需要用到背景图片,好看又自适应太难了!
背景图片自适应屏幕
body {
background-image: url('http://www.17sucai.com/preview/1257759/2018-12-25/%E6%88%91%E7%9A%84%E4%B9%A6%E5%B1%8B/img/bgImg.jpg');
/*background-repeat: no-repeat;*/
background-size: 100%;
background-attachment: fixed;
background-color: #fff;
background-repeat: no-repeat;
background-size: cover;
-webkit-background-size: cover;
-o-background-size: cover;
background-position: center 0;
}
如有不解,请加java爱好群大家交流:852665736;群里都是热心好客的小伙伴,大家一同进步。
无偿免费分享源码以及技术和面试文档,更多优秀精致的源码技术栈分享请关注微信公众号:gh_817962068649