<!DOCTYPE html>
<html lang="en-US">
<head>
<style>
div{
width:100px;
height:100px;
border:1px solid #000;
font-size:17px;
}
#outerDiv{
background:#f69d3c;
margin: 50px 70px;
perspective: 100px;
-webkit-perspective: 100px;
}
#innerDiv{
background:#0066ff;
transform: rotate3d(1, 1, 1, 45deg);
-webkit-transform: rotate3d(1, 1, 1, 45deg);
}
</style>
</head>
<body>
<h1>CSS perspective Property</h1>
<div id="outerDiv">outerDiv
<div id="innerDiv">innerDiv</div>
</div>
<button onclick="myFunction()">Click Me</button>
<script>
var x = document.getElementById("outerDiv");
function myFunction(){
x.style.perspective = "400px";
x.style.WebkitPerspective = "400px";
}
</script>
<p>Click on the button to change the 'perspective' from 100px to 400px.</p> </body>
</html>