[wd_asp elements=’search’ ratio=’100%’ id=1]

Flip Div using Css3

7th February 2015

CSS

Css - Codehaven

When hovering over an image it will use the CSS to implement an image flip.

#f1_container {
position: relative;
margin: 10px auto;
width: 450px;
height: 330px;
z-index: 1;
}
#f1_container {
perspective: 1000;
}
#f1_card {
width: 100%;
height: 100%;
transform-style: preserve-3d;
transition: all 1.0s linear;
}
#f1_container:hover #f1_card {
transform: rotateY(180deg);
box-shadow: -5px 5px 5px #aaa;
}
.face {
position: absolute;
width: 100%;
height: 100%;
backface-visibility: hidden;
}
.face.back {
display: block;
transform: rotateY(180deg);
box-sizing: border-box;
padding: 10px;
color: white;
text-align: center;
background-color: #aaa;
}