<template>
<divclass="parentBox">
<divclass="imgBox">
<imgsrc="https://i.postimg.cc/4xxZNsL6/1677486088618.png">
</div>
<divclass="contantBox">详细内容</div>
</div>
</template>
<stylescoped>
.parentBox{
box-shadow:2px2px8px-1pxcornflowerblue;
width:200px;
height:200px;
position:relative;
cursor:pointer;
}
.imgBox{
position:absolute;
width:100%;
height:100%;
z-index:20;
-webkit-transition:all0.5sease;
transition:all0.5sease;
bottom:0;
}
img{
width:100%;
height:100%;
}
.parentBox:hover.imgBox{
bottom:60px;
}
.contantBox{
padding:4px;
color:white;
width:100%;
height:60px;
background:cornflowerblue;
position:absolute;
bottom:0;
}
</style>
|