<!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 {
height: 200px;
width: 200px;
}
#big-div {
width: 400px;
height: 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>
Web / CSS / hk1
于 2024-08-24 16:33:25 首次发布