When I apply transform to image, it transforms but in 2d way. perspective doesn't seems to work. However its perfect in opera/chrome. When I apply to div of image, perspective works perfectly. Here's my code:-
<!DOCTYPE html>
<html>
<head>
<title>Testing Scripts</title>
<!--[if lte IE 8]><script src="script/html5.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
<div class="slider">
<div class="sliced"><img src="images/1.jpg"></div>
</div>
</body>
</html>
style.css
body {
width: 960px;
margin: 100px auto;
}
.slider {
-webkit-perspective : 600px;
-moz-perspective : 600px;
position: relative;
}
.sliced {
position: absolute;
}
.sliced img{
-webkit-transform : rotateX(80deg);
-moz-transform : rotateX(80deg);
}
If I change it to
.sliced{
-webkit-transform : rotateX(80deg);
-moz-transform : rotateX(80deg);
}
It works prefectly. Any reasons or i am missing something? Here is my code pen