console
<!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></title>
<style>
#test {
width: 20px;
height: 20px;
background-color: pink;
transition: opacity .3s ease;
}
.one {
position: relative
}
</style>
<body>
<div id="test"></div>
<div class="one">
<div class="one1">
<div class="one1">
</div>
</div>
</div>
</body>
<script>
$(document).ready(function(){
setTimeout(()=>{
$('#test').css('opacity','0')
},3000)
})
</script>
</head>
</html>
<!-- <!DOCTYPE html>
<html>
<head lang="zh-cmn-Hans">
<meta charset="UTF-8">
<title></title>
<style>
#d1{
height: 100px;
position: relative;
overflow: hidden;
}
#d1:hover > #d3{
transform: translateY(-100%);
}
#d2{
background: red;
height: 100px;
}
#d3{
color: pink;
background: green;
height: 100px;
opacity: 0.6;
transition: transform 0.5s ease;
}
</style>
</head>
<body>
<div id="d1">
<div id="d2"></div>
<div id="d3">12312313</div>
</div>
</body>
</html> -->
<style>
.div1 {
width: 100px;
height: 100px;
background: red;
position: absolute;
left: 0;
top: 0;
z-index: 1;
}
.div2 {
width: 100px;
height: 100px;
background: blue;
position: relative;
z-index: -1;
}
</style>
</head>
<body>
<div class="div1"></div>
<div class="div2"></div>
</body>