23.2.13

CSS3 Flip Effect

Tutorial Blog for Stylish Blogger

Kode CSS
#flip-container {
    display: inline-block;
    text-align: justify;
}  
#flip-card {
    transform-style: preserve-3d;
    perspective: 1000;
    width: 400px;
    height: 400px;
    position: relative;
}   
.flip-back, .flip-front {
    position: absolute;
    backface-visibility: hidden;
    transition: transform 1s ease-in-out;
    width: 100%;
    height: 100%;   
    font-weight: bold;
    box-shadow: inset 0px 0px 20px rgba(0,0,0,0.4);
    border-radius: 4px;
}
.flip-back p, .flip-front p {
text-align: center;
padding-top: 350px;
color: #f00;
text-shadow: 0 -3px 3px #ff0;
font-family: Helvetica, Arial, sans-serif;
}
.flip-back {
    transform: rotateX(180deg);
    overflow: hidden;
}   
.flip-front {
    background: url('GAMBAR TAMPAK DEPAN');
}
#flip-container:hover .flip-back {   
    transform: rotateX(0deg);
}
#flip-container:hover .flip-front {      
    transform: rotateX(-180deg);
}
Markup
<div id="flip-container">
<div id="flip-card">
<div class="flip-front"><p>Tutorial Blog for Stylish Blogger</p></div>
<div class="flip-back">
<img src="GAMBAR TAMPAK BELAKANG" />
</div>
</div>
</div>

Loading...
Loading...