wiki/开发/前端/HTMLCSS/HTMLCSS练习/综合案例/综合案例15-双开门.html
2025-01-02 10:46:09 +08:00

51 lines
1.0 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
.father {
margin: 100px auto;
width: 400px;
height: 400px;
display: flex;
background-color: black;
overflow: hidden;
}
.son1 {
width: 200px;
height: 400px;
background-color: blueviolet;
transition: all 10s;
}
.son2 {
width: 200px;
height: 400px;
background-color: burlywood;
transition: all 10s;
}
.father:hover {
.son1 {
transform: translate(-100%);
}
.son2 {
transform: translate(100%);
}
}
</style>
</head>
<body>
<div class="father">
<div class="son1">
</div>
<div class="son2">
</div>
</div>
</body>
</html>