I've been working on a cool animation for a button on my website. When a user hovers over it, the button skews from right to left. The problem is that the text inside the button also skews with it, which is not the effect I want to achieve. I attempted using JavaScript to fix this issue but haven't had any success so far. Here's the code snippet I have:
.btnredskewed
{
font-family: 'cabinbold';
border: #f94f4f solid 3px;
border-radius: 6px;
background-color: #f94f4f;
color: #ffffff;
font-size: 15px;
padding-top: 8px;
padding-bottom: 8px;
padding-left: 10px;
padding-right: 10px;
cursor: pointer;
text-transform: uppercase;
transition: 0.2s;
-ms-transform: skewX(-20deg); /* IE 9 */
-webkit-transform: skewX(-20deg); /* Safari */
transform: skewX(-20deg);
}
.btnredskewed:hover
{
font-family: 'cabinbold';
border: #9cbce4 solid 3px;
border-radius: 6px;
background-color: #9cbce4;
color: #ffffff;
font-size: 15px;
padding-top: 8px;
padding-bottom: 8px;
padding-left: 10px;
padding-right: 10px;
cursor: pointer;
text-transform: uppercase;
-ms-transform: skewX(20deg); /* IE 9 */
-webkit-transform: skewX(20deg); /* Safari */
transform: skewX(20deg);
}
.unskewtext
{
-ms-transform: skewX(20deg); /* IE 9 */
-webkit-transform: skewX(20deg); /* Safari */
transform: skewX(20deg);
}
.unskewtext:hover
{
-ms-transform: skewX(-20deg); /* IE 9 */
-webkit-transform: skewX(-20deg); /* Safari */
transform: skewX(-20deg);
}
<a href="#mogelijkheden"><button type="button" class="btnredskewed margintopsmall"><div class="unskewtext">explore the options</div></button></a>