使用transform-style屬性來設(shè)置嵌套元素在3D空間中的渲染方式。
您可以嘗試運行以下代碼來實現(xiàn)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>
登錄后復(fù)制
以上就是CSS 中轉(zhuǎn)換樣式屬性的使用的詳細內(nèi)容,更多請關(guān)注www.92cms.cn其它相關(guān)文章!






