麻烦, 直接上代码下次要直接用
<!DOCTYPE html>
<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>Document</title>
</head>
<style>
html,
body {
margin: 0;
padding: 0;
}
* {
box-sizing: border-box;
}
body {
height: 100vh;
width: 100vw;
}
.container {
height: 100vh;
border: 3px;
box-sizing: border-box;
width: 100vw;
/* height: 100vh; */
background: url("https://img.js.design/assets/img/63ef2b5568826c11e82c2c4a.jpg#b94719d8fcee1307747879bcc66e92e8")
no-repeat;
background-position: left center;
background-size: cover;
margin: 0;
padding: 0;
}
</style>
<body>
<div class="container"></div>
</body>
</html>