Reputation: 885
I'm trying to make transition stuff by -25 degrees but what i want is to only transit "box", not the font. The thing that i don't understand is how to make it with :before/:after. Whenever i try to do it via CSS it basically ignores all setting i've made for specific container.
.option:hover
{
font-style: normal !important;
background-color: green;
cursor: pointer;
box-sizing: border-box;
transition-property: background;
transition-duration: .4s;
left: 0;
top: 0;
-webkit-transform: skew(-25deg);
}
Upvotes: 0
Views: 33
Reputation: 9319
The thing is that you skew the whole div, which includes anything inside. There's no way to exclude anything.
There are two ways around this:
::before
, give it full parent size and skew this one. It's outside your text, so that's not affected by the transform. In addition, use z-index to place it behind the parent div. JSFiddleUpvotes: 1