By applying transform: rotate(-2deg);
to a section
, I have created an effect where the section rotates slightly. Additionally, when the user hovers over the same section
, it increases in size due to transform: scale(1.1);
.
However, on one specific page of my website, I want to keep the rotation intact but eliminate the scaling effect when the user hovers over the section. Is there a method to reset transform: scale(1.1);
without altering transform: rotate(-2deg);
?
The complete code snippet is as follows:
section {
display: block;
width: 100px;
height: 100px;
padding: 10px;
background: red;
/* Rotate */
-webkit-transform: rotate(-2deg);
-moz-transform: rotate(-2deg);
-ms-transform: rotate(-2deg);
-o-transform: rotate(-2deg);
transform: rotate(-2deg);
/* Easing */
-webkit-transition: -webkit-transform .2s ease-in-out;
-moz-transition: -moz-transform .2s ease-in-out;
-o-transition: -o-transform .2s ease-in-out;
transition: transform .2s ease-in-out;
}
section:hover {
-webkit-transform: scale(1.1);
-moz-transform: scale(1.1);
-ms-transform: scale(1.1);
-o-transform: scale(1.1);
transform: scale(1.1);
}
.some-page section:hover {
-webkit-transform: none;
-moz-transform: none;
-ms-transform: none;
-o-transform: none;
transform: none;
}
You can view the interactive demo on JSFiddle here.