工程课 Web-2.1. homework_1
原题链接
简单
<!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>
<style>
div {
color: white;
width: 300px;
height: 300px;
}
div:nth-child(odd) {
background-color: #0000FF;
}
div:nth-child(even) {
background-color: rgba(255, 0, 0, 0.7);
}
.small-div {
width: 200px;
height: 200px;
}
#big-div {
height: 400px;
width: 400px;
}
.hover-div:hover {
background-color: orange;
}
</style>
</head>
<body>
<div class="small-div">1</div>
<div id="big-div">2</div>
<div>3</div>
<div class="small-div">4</div>
<div class="small-div hover-div">5</div>
<div>6</div>
<div>7</div>
<div class="hover-div">8</div>
<div>9</div>
<div>10</div>
</body>
</html>