指定如何在3D空间中渲染嵌套元素
要指定如何在3D空间中渲染嵌套元素,请使用CSS中的transform-style属性。
您可以尝试运行以下代码以实现transform-style属性:
示例
<!DOCTYPE html>
<html>
<head>
<style>
.demo1 {
width: 300px;
height: 300px;
background-color: yellow;
}
.demo2 {
width: 200px;
height: 200px;
background-color: orange;
}
.demo3 {
width: 100px;
height: 100px;
background-color: blue;
transform: rotate(10deg);
transform-origin: 30% 40%;
transform-style: preserve-3d;
}
</style>
</head>
<body>
<h1>Rotation</h1>
<div class = "demo1">Demo
<div class = "demo2">Demo
<div class = "demo3">
Demo
</div>
</div>
</div>
</body>
</html>热门推荐
10 卖奶茶开张祝福语简短
11 写给女友的祝福语++简短
12 生日祝福语陌生女生简短
13 女士简短祝福语大全集
14 祝福语简短的微信
15 爸妈金婚文案祝福语简短
16 对部门师姐祝福语简短
17 生日摆摊祝福语简短独特
18 广场周年庆祝福语 简短