首页 > Web开发 > 详细

css3 景深

时间:2017-02-11 12:34:49      阅读:212      评论:0      收藏:0      [点我收藏+]

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

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!