<!DOCTYPE>
<html>
<head>
<meta charset="utf-8"/>
<title>下划线动画</title>
<style>
*{
margin: 0;
padding: 0;
}
#pic{
width: 212px;
height: 300px;
border: 5px solid whitesmoke;
box-shadow: 0 0 0 8px pink;
margin: 100px auto;
overflow:hidden;
position: relative;
}
#pic img{transition: all 0.6s;}
#pic:hover img{
transform: scale(1.5,1.5);
}
#pic p{
width: 212px;
height: 20px;
background: black;
opacity: 0.5;
position: absolute;
bottom: -20px;
color: white;
font-family: "微软雅黑";
font-size: 13px;
text-align: center;
}
#pic:hover p{
bottom: 0px;
transition: bottom 1s;
}
</style>
</head>
<body>
<div id="pic">
<img src="images/5.jpg" width="212" height="300"/>
<p>我的世界就如一座城池</p>
</div>
</html>
</body>
</html>
<html>
<head>
<meta charset="utf-8"/>
<title>下划线动画</title>
<style>
*{
margin: 0;
padding: 0;
}
#pic{
width: 212px;
height: 300px;
border: 5px solid whitesmoke;
box-shadow: 0 0 0 8px pink;
margin: 100px auto;
overflow:hidden;
position: relative;
}
#pic img{transition: all 0.6s;}
#pic:hover img{
transform: scale(1.5,1.5);
}
#pic p{
width: 212px;
height: 20px;
background: black;
opacity: 0.5;
position: absolute;
bottom: -20px;
color: white;
font-family: "微软雅黑";
font-size: 13px;
text-align: center;
}
#pic:hover p{
bottom: 0px;
transition: bottom 1s;
}
</style>
</head>
<body>
<div id="pic">
<img src="images/5.jpg" width="212" height="300"/>
<p>我的世界就如一座城池</p>
</div>
</html>
</body>
</html>