3D旋转(CSS3)
原创
©著作权归作者所有:来自51CTO博客作者CMMKK的原创作品,请联系作者获取转载授权,否则将追究法律责任
3D旋转(CSS3)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>3D旋转 rotate3d
</title>
<style>
body {
/* perspective: 500px; */
perspective: 200px;
/* 立体效果更加明显 */
}
img {
width: 249px;
height: 249px;
display: block;
margin: 100px auto;
transition: all 1s;
}
img:hover {
/* transform: rotateX(180deg); */
/* transform: rotateX(360deg); */
/* transform: rotateX(45deg); */
/* transform: rotateY(180deg); */
/* transform: rotateY(45deg); */
/* transform: rotateZ(180deg); */
transform: rotate3d(1, 0, 0, 45deg);
}
</style>
</head>
<body>
<img src="xg.png" alt="">
</body>
</html>