For some reason I can't get this simple css animation using point of origin and pseudoelement to work, the text should flip on its own center.
Take a look at the code:
.flip{
border: none;
background-color:none;
color: black;
padding: 5px 10px;
font-size: 18px;
border-radius: 4px;
position: relative;
box-sizing: border-box;
transition: all 500ms ease;
transform-style: preserve-3d;
}
flip:after {
top: -100%;
left: 0px;
width: 100%;
position: absolute;
background: none;
border-radius: 4px;
content: 'flipped';
transform-origin: left bottom;
transform: rotateX(90deg);
}
flip:hover {
transform-origin: center bottom;
transform: rotateX(-90deg) translateY(100%);
}
<a class="flip" href="">flip</a>