Disclaimer: This article is copyrighted final HrainOne all, welcome to reprint, please declare final copyright https://blog.csdn.net/gaoxin_gx/article/details/90318111
<style>
body{
background:url("img/background.jpg") no-repeat center fixed;
<!-- 目的:兼容性 -->
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
</style>
This code is in the head, and not to mistake the <body>