<div class="testBefore"><h1>BEFORE</h1></div>
<div class="fixedBg"></div>
<div class="testAfter"><h1>AFTER</h1></div>
<style>
body,html{ height: 100%; }
*{ margin: 0; padding: 0; }
.fixedBg{
min-height: 300px;
background-image: url("https://www.supermap.com/pic/toppic/2018821121812QQ%E5%9B%BE%E7%89%8720180821121532.jpg");
background-position: top center;
background-repeat: no-repeat;
background-attachment: fixed;
background-size: cover;
}
.testBefore,.testAfter{
background: #333;
width: 100%;
height: 500px;
text-align: center;
}
h1{
color: #fff;
font-size: 100px;
line-height: 300px;
}
</style>