.骰子 {
width: 200px;
height: 200px;
background-color: #ccc;
position: relative;
width: 200px;
height: 200px;
position: absolute;
top: 0;
left: 0;
transform: rotateY(60deg);
transform: rotateY(120deg);
transform: rotateY(200deg);
transform: rotateY(240deg);
transform: rotateY(280deg);
transform: rotateY(320deg);
transform: rotateY(360deg);
function rotate() {
var div=document.querySelector(".骰子");
var旋轉角度=60; // 60度
div.style.transform="rotate(" +旋轉角度 + "deg)";