码迷,mamicode.com
首页 > Web开发 > 详细

css3 放大scale

时间:2018-04-07 17:44:35      阅读:1915      评论:0      收藏:0      [点我收藏+]

标签:margin   图片   nsf   放大   pac   figure   cal   hid   image   

<!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>

技术分享图片

css3 放大scale

标签:margin   图片   nsf   放大   pac   figure   cal   hid   image   

原文地址:https://www.cnblogs.com/yuanyuan-1994/p/8733483.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!