CSS3 Issue about transform animation -
I am learning CSS3 features during these days. I try to apply the effect (jsfiddle)
Here is the code.
html, body {margin: 0; Padding: 0; Background color: #ccc; }. Container {status: relative; Width: 300px; Height: 500px; Margins: 5% auto; Perspective: 500px; } # Card {width: 100%; Height: 100%; Background color: # 567890; Webkit-Animation: Flip 1S; Conversion-style: protection-3d; Status: Relative; } @ -WebKit-keyframe flip {0% {transforms: rotate Y (0 degree); } 100% {conversion: rotate (180 degrees); }} .Front, .back {status: absolute; Backfirst-visibility: hidden; Width: 100%; Height: 100%; Top: 0; Left: 0; } #card .front {background: red; } #card .back {background: blue; Convulsually rotate (180 degrees); } and HTML.
& lt; Div class = "container" & gt; & Lt; Div id = "card" & gt; & Lt; Figure class = "front" & gt; 1 & lt; / Statistic & gt; & Lt; Data class = "back" & gt; 2 & lt; / Statistic & gt; & Lt; / Div & gt; / Div> These are the problems.
-
The front and rear two sides in the divis The transition should be backwards from the front side. But in this program, it gives the front.
-
The front and back side positions are not correct. They should be inside the Div Card.
Can anyone help me? thanks a lot!
Instead of rotating you Why do not you rotate the front and back div contrast Keyframe added to
front and back div @ - WebKit-Kefreem Front { 0% {transform: rotate (0deg); } 100% {conversion: rotate (180 degrees); }} @ -webkit-keyframe back {0% {transform: rotate Y (-180 degrees); } 100% {conversion: rotate (0deg); }}
Comments
Post a Comment