CSS之perspective

<!DOCTYPE html>
<html>
<head>
<style>
#div1
{
position: relative;
height: 150px;
width: 150px;
margin: 50px;
padding:10px;
border: 1px solid black;
perspective:150;
-webkit-perspective:150; 
}
 
#div2
{
padding:50px;
position: absolute;
border: 1px solid black;
background-color: gray;
transform: rotateX(45deg);
-webkit-transform: rotateX(45deg); 
}
</style>
</head>
 
<body>
 
<div id="div1">
  <div id="div2">HELLO</div>
</div>
  
</body>
</html>

  

 run:

posted @ 2016-03-07 23:13  冷的锋刃  阅读(258)  评论(0编辑  收藏  举报