我試圖讓一個懸掛在CSS中的3d轉換功能。我的代碼在這裏直接從教程中直接複製,因爲無論我多麼努力,我都無法正常工作。鏈接到它是如何應該看起來是:http://desandro.github.com/3dtransforms/examples/card-01.htmlCSS 3d透視關閉
,我的代碼是:
<html>
<head>
<style media="screen">
.container {
width: 200px;
height: 260px;
position: relative;
-webkit-perspective: 800;
}
#card {
width: 100%;
height: 100%;
position: absolute;
-webkit-transform-style: preserve-3D;
-webkit-transition: -webkit-transform 2s;
}
#card figure {
display: block;
position: absolute;
width: 100%;
height: 100%;
-webkit-backface-visibility: hidden;
}
#card .face1 {
background: red;
}
#card .face2 {
background: blue;
-webkit-transform: rotateY(180deg);
}
#card:hover {
-webkit-transform: rotateY(180deg);
}
</style>
</head>
<body>
<section class="container">
<div id="card">
<figure class="face1">1</figure>
<figure class="face2">2</figure>
</div>
</section>
</body>
</html>
就像我說的它從教程字幾乎字,我唯一改變的是使用懸停代替按鈕。謝謝你的幫助。
現在完美工作,謝謝。 – jrl589 2012-07-27 22:10:51