0

How to make a skewed shape stay skewed when clicked?

Hello, I'm trying to make a skewed shape stay skewed when clicked, but the following code does not do that. It looks like a diamond before click and looks like square after click, but I want it to stay as a diamond shape. How can I fix this? Thank you! CSS .keys{ border: 1px solid black; width: 15px; height: 15px; background-color: white; transform: skew(-10deg); } .keys:active { transform:translateY(5px); } HTML <div class="keys"></div>

1st Aug 2020, 10:22 PM
DMo
3 ответов
0
add to transform in active transform:skew(-10deg) translateY(5px);
1st Aug 2020, 10:51 PM
Abhay
Abhay - avatar
+ 1
✌️
1st Aug 2020, 11:22 PM
Abhay
Abhay - avatar
0
This worked, thank you! I thought the skew would be inherited
1st Aug 2020, 11:21 PM
DMo