<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width;initial-scale=1.0" />
<base target="_blank" />
<title>CSS3六角型旋转效果</title>
<style type="text/css">
*
{
margin:0;
padding:0;
}
#Nice
{
position:absolute;
left:50%;
top:50%;
z-index:60;
width:180px;
height106px;
margin:-53px 0 0 -90px;
}
#Nice_demo
{
width:180px;
margin:auto;
text-align:center;
transition:10s ease-out;
-webkit-transition:10s ease-out;
-moz-transition:10s ease-out;
-o-transition:10s ease-out;
}
#Nice_demo:hover
{
transform:rotate(2160deg);
-webkit-transform:rotate(2160deg);
-moz-transform:rotate(2160deg);
-o-transform:rotate(2160deg);
}
#Nice_demo:hover>#Nice_box_demo,#Nice_demo:hover>#Nice_box_demo>#Nice_one,#Nice_demo:hover>#Nice_box_demo>#Nice_two
{
background:rgba(108,188,208,0.4);
}
#Nice_box_demo,#Nice_box_demo>#Nice_one,#Nice_box_demo>#Nice_two
{
width:180px;
height:105px;
background:rgba(68,68,68,0.6);
transition:all 10s ease;
-webkit-transition:all 10s ease;
-moz-transition:all 10s ease;
-o-transition:all 10s ease;
}
#Nice_box_demo
{
position:relative;
}
#Nice_box_demo>#Nice_one,#Nice_box_demo>#Nice_two
{
position:absolute;
top:0;
left:0;
}
#Nice_box_demo>#Nice_one
{
transform:rotate(60deg);
-webkit-transform:rotate(60deg);
-moz-transform:rotate(60deg);
-o-transform:rotate(60deg);
z-index:1;
}
#Nice_box_demo>#Nice_two
{
transform:rotate(-60deg);
-webkit-transform:rotate(-60deg);
-moz-transform:rotate(-60deg);
-o-transform:rotate(-60deg);
z-index:2;
}
</style>
</head>
<body>
<div style="background:rgba(50,140,240,0.8);color:white;height:42px;line-height:42px;font-size:1em;text-align:center;position:absolute;left:0;top:0;right:0;z-index:86;">六角型旋转效果</div>
<div id="Nice">
<div id="Nice_demo">
<div id="Nice_box_demo">
<div id="Nice_one"></div>
<div id="Nice_two"></div>
</div>
</div>
</div>
</body>
</html>
Back to home |
File page
Subscribe |
Register |
Login
| N