1
1
12332112021-06-15 12:42:03
css
1233211, 2021-06-15 12:42:03

How to rotate an icon 360 degrees when clicked?

How to rotate an icon 360 degrees when clicked?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Markov, 2021-06-15
@1233211

Styles

.icon {
  transition: .3s;
  &.active {
    transform: rotate(360deg);
  }
}

Script:
In the click handler, add the active class to the icon

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question