效果图:
添加效果前:

添加效果后:

CSS:
.box {
width: 310px;
height: 260px;
margin: 20px auto;
/* 景深:离视线的距离 */
perspective: 800px;
background-color: red;
display: flex;
justify-content: center;
align-items: center;
}
.box .pic{
width: 200px;
height: 130px;
line-height: 130px;
text-align: center;
background-color: #000;
position: relative;
/* 设置3d环境 */
transform-style:preserve-3d;
transform: rotateY(-60deg);
color: #fff;
font-size: 30px;
}
本文详细介绍如何使用CSS实现3D变换效果,包括景深、旋转等属性的应用,通过实例展示了如何创建一个具有3D旋转效果的图片盒子。
582

被折叠的 条评论
为什么被折叠?



