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>