案例1:
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title></title>
<style>
body {
/* background-image: url(https://game.gtimg.cn/images/yxzj/coming/v2/skins//image/20220301/16461232836114.jpg);
background-repeat: no-repeat;
background-position: center top;
background-color: black
; */
color: #fff;
font-size: 20px;
/* background-attachment: fixed; */
background: black url(https://game.gtimg.cn/images/yxzj/coming/v2/skins//image/20220301/16461232836114.jpg) no-repeat fixed center top;
}
</style>
</head>
<p>蔡文姬</p>
<p>蔡文姬</p>
<p>蔡文姬</p>
<p>蔡文姬</p>
<p>蔡文姬</p>
<p>蔡文姬</p>
</body>
</html>
效果图