It was basically just a specificity issue. Make the selector more specific.
a.rotated
has a specificity value of11
. (type + class)a#iTryHtml5:hover
has a specificity of111
. (type + id + pseudo class)a#iTryHtml5.rotated
also has a specificity of111
. (type + id + class)
a#iTryHtml5.rotated {
-webkit-transform: rotateY(180deg);
}
When you were hovering over the element, the selector a#iTryHtml5:hover
was overwriting the styling from a.rotated
. You were therefore not seeing the element rotate until after the more specific selector was removed from the equation.
You should also add in the following selector to prevent another specificity issue when hovering over the rotated element. In other words, this just allows you to increase the scale of the element when hovering over the rotated version.
a#iTryHtml5.rotated:hover {
-webkit-transform: scale(1.1) rotateY(180deg);
}