【发布时间】:2014-01-15 15:50:11
【问题描述】:
我有一些 css 3D div,但我遇到了一些问题.. 我想透视旋转外部 div,但我不想用它旋转内部 div。如何重置这些样式以使内部 div 再次变平。
HTML:
<section class="container" style="-webkit-perspective: 2000px; -webkit-perspective-origin-x: 0%; -webkit-perspective-origin-y: 0%;">
<div id="cube">
<div class="bottom plutoring">
<div class="planet pluto">
<p> pluto </p>
</div>
</div>
</div>
CSS
.container {
width: 1000px;
height: 900px;
position: relative;
margin: 0 auto 40px;
-webkit-perspective: 1200px;
-moz-perspective: 1200px;
-o-perspective: 1200px;
perspective: 1200px;
}
#cube {
width: 100%;
height: 100%;
position: absolute;
-webkit-transform-style: preserve-3d;
-moz-transform-style: preserve-3d;
-o-transform-style: preserve-3d;
transform-style: preserve-3d;
}
.bottom {
-webkit-transform: rotateX( 82deg ) rotateY( -5deg ) rotateZ( 197deg );
}
有什么建议吗?
【问题讨论】:
-
我认为您的问题可能与保留 3d 相关。用您的代码创建了一个小提琴,但不清楚。 jsfiddle.net/dKVCm
-
更新小提琴:jsfiddle.net/dKVCm/1 不是解决方案,但至少可以玩。
标签: html css 3d transform perspective