指定如何在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>热门推荐
5 带清的简短祝福语
10 大雪生日祝福语大全简短
11 修祖屋祝福语简短
12 祝福语大全简短赞美同学
13 发小结婚简短祝福语
14 圣诞祝福语简短小学
15 中考祝福语简短卡片大全
16 庆双节祝福语简短
17 永远漂亮祝福语女生简短
18 写给男生简短的祝福语