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>
3 Answers
0
add to transform in active
transform:skew(-10deg) translateY(5px);
+ 1
âïž
0
This worked, thank you! I thought the skew would be inherited