css3 放大scale

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
body,ol,ul,h1,h2,h3,h4,h5,h6,p,th,td,dl,dd,form,fieldset,legend,input,textarea,select,figure,figcaption{margin:0;padding:0}
body{font:14px"微软雅黑","Arial Narrow",HELVETICA;}
figure{
float: left;
width: 33%;
overflow: hidden;
position: relative;
background: #2f0000;
}
figure img{
height: 400px;
opacity: 0.9;
transition: all 1s;
}
figcaption{
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
figcaption h3{
color: #ffffff;
margin: 10% 0 0 12%;
transition: all 1s;
transform: sacle(1.2,1.2);
opacity: 0;
}
figcaption p{
background:#ffffff;
color: #000000;
margin:15px;
font-size: 13px;
text-align: center;
width: 130px;
height: 20px;
line-height: 20px;
transition: all 1s;
transform: sacle(1.2,1.2);
opacity: 0;
}
figcaption div{
border: 2px solid #ffffff;
width: 80%;
height: 80%;
position: absolute;
top: 10%;
left: 10%;
transition: all 1s;
transform: sacle(1.2,1.2);
opacity: 0;
}
figure:hover figcaption div{
transform: scale(1,1);
opacity: 1;
}
figure:hover img{
opacity: 0.5;
transform: scale(1.2,1.2);
}

figure:hover figcaption h3{
transform: scale(1,1);
opacity: 1;
}
figure:hover figcaption p{
transform: scale(1,1);
opacity: 1;
}
</style>
</head>
<body>

<figure>
<img src="images/2.jpg">
<figcaption>
<h3>标题标题</h3>
<p>文字文字文字文字</p>
<div></div>
</figcaption>
</figure>
<figure>
<img src="images/3.jpg">
<figcaption>
<h3>标题标题</h3>
<p>文字文字文字文字</p>
</figcaption>
</figure>
</body>
</html>


posted @ 2018-04-07 15:40  园园张  阅读(239)  评论(0编辑  收藏  举报