工程课 Web-2.3. homework_3
原题链接
简单
作者:
L-China
,
2022-12-24 10:37:53
,
所有人可见
,
阅读 256
CSS
$CSS$ $code:$
<style>
div {
width: 300px;
height: 300px;
margin: 10px;
}
div:nth-child(1) {
background-color: lightblue;
}
div:nth-child(2) {
background-image: url('/static/images/mountain.jpg');
background-size: 100% 100%;
background-repeat: no-repeat;
}
div:nth-child(3) {
background-image: url('/static/images/mountain.jpg'), url('/static/images/logo.png');
background-size: 50% 100%, 50% 100%;
background-repeat: no-repeat;
background-position: top left, 150px 0;
}
div:nth-child(4) {
background-image: url('/static/images/mountain.jpg');
background-size: 100% 100%;
background-repeat: no-repeat;
background-attachment: fixed;
}
</style>
$AC$ $code:$
<!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>homework_3</title>
<style>
div {
width: 300px;
height: 300px;
margin: 10px;
}
div:nth-child(1) {
background-color: lightblue;
}
div:nth-child(2) {
background-image: url('/static/images/mountain.jpg');
background-size: 100% 100%;
background-repeat: no-repeat;
}
div:nth-child(3) {
background-image: url('/static/images/mountain.jpg'), url('/static/images/logo.png');
background-size: 50% 100%, 50% 100%;
background-repeat: no-repeat;
background-position: top left, 150px 0;
}
div:nth-child(4) {
background-image: url('/static/images/mountain.jpg');
background-size: 100% 100%;
background-repeat: no-repeat;
background-attachment: fixed;
}
</style>
</head>
<body>
<div></div>
<div></div>
<div></div>
<div></div>
</body>
</html>