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

css3 景深

时间:2017-02-11 12:38:06      阅读:303      评论:0      收藏:0      [点我收藏+]

标签:pac   for   pre   tom   ota   idt   div   jpg   card   

<!DOCTYPE html>
<html>
<head>
<title>景深</title>
<style type="text/css">
.box{
width: 400px;
height: 400px;
margin: 100px auto;
position: relative;
transform-style: preserve-3d;
/*景深相当于眼睛距离元素的位置距离*/
perspective: 100px;
/*眼睛距元素的偏移位置*/
perspective-origin: 10px 100px;
}
img:nth-child(1){
width: 400px;
height: 400px;
opacity: 0;
}
img:nth-child(2){
width: 150px;
height: 200px;
position: absolute;
left: 0;
right: 0;
bottom: 0;
top: 0;
margin: auto;
opacity: 0;
}
img:nth-child(3){
width: 150px;
height: 200px;
position: absolute;
left: 0;
right: 0;
bottom: 0;
top: 0;
margin: auto;
transform: rotateX(30deg);
}
</style>
</head>
<body>
<div class="box">
<img src="img/bg-grid.jpg">
<img src="img/cardKingClub.png">
<img src="img/dameizi.jpeg">
</div>
</body>
</html>

css3 景深

标签:pac   for   pre   tom   ota   idt   div   jpg   card   

原文地址:http://www.cnblogs.com/adialike/p/6388938.html

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