指定如何在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>热门推荐
8 入学校简短祝福语
10 表妹结婚祝福语简短藏语
11 给司机老师祝福语简短
12 生日寿宴祝福语简短精辟
13 送花简短有内涵祝福语
14 小年好的祝福语简短
15 春节期间祝福语大全简短
16 爱小姨文案祝福语简短
17 简短古文生日祝福语
18 结业蛋糕男生祝福语简短