我正在处理下拉菜单,当我单击图像时,它会缩放和旋转。这一切都很好,但是当我再次单击它时,我希望它恢复到正常状态。
#arrow {
z-index: 2;
position: absolute;
-webkit-transition: all 1s ease-in-out;
-moz-transition: all 1s ease-in-out;
-o-transition: all 1s ease-in-out;
-ms-transition: all 1s ease-in-out;
transition: all 1s ease-in-out;
}
#arrow:target {
transform: scale(1.2) rotate(45deg);
-ms-transform: scale(1.2) rotate(45deg);
-webkit-transform: scale(1.2) rotate(45deg);
-moz-transform: scale(1.2) rotate(45deg);
-o-transform: scale(1.2) rotate(45deg);
margin-top: 1em;
}
这是jsfiddle:点击我=)