Reputation: 171
I'm working on a website currently and I try to make the profile picture have a border-radius so it is round. This works in first instance, but after 1 second it pops back to a square.
The profile picture also flips around when hovered.
Any solutions?
.border
{
-moz-border-radius: 100px;
-webkit-border-radius: 100px;
border-radius: 100px;
}
.roundedImage {
overflow:hidden;
position:relative;
-moz-border-radius: 100px;
-webkit-border-radius: 100px;
border-radius: 100px;
width: 200px;
height:200px;
margin-left: auto;
margin-right: auto;
-webkit-animation:pop-in 0.8s;
-moz-animation:pop-in 0.8s;
-ms-animation:pop-in 0.8s;
}
.flip-container {
perspective: 1000;
z-index:3;
}
.flip-container:hover .flipper, .flip-container.hover .flipper {
transform: rotateY(180deg);
}
.flip-container, .front, .back {
width: 200px;
height: 200px;
margin-left:auto;
margin-right:auto;
}
.flipper {
transition: 0.6s;
transform-style: preserve-3d;
}
.front, .back {
backface-visibility: hidden;
position: absolute;
top: 0;
left: 0;
}
.front {
transform: rotateY(0deg);
}
.back {
transform: rotateY(180deg);
}
<div class="border">
<div class="flip-container" ontouchstart="this.classList.toggle('hover');">
<div class="roundedImage">
<div class="flipper">
<div class="front">
<div style="background: url(Images/L2351108.jpg); height:200px; background-size: cover;"></div>
</div>
<div class="back">
<div style="background:url(Images/L2351070.jpg); height:200px; background-size:cover;"</div>
</div>
</div>
</div>
</div>
</div>
Upvotes: 1
Views: 67