D
D
DotDash2018-02-07 23:33:28
css
DotDash, 2018-02-07 23:33:28

Why does translate work right away?

Why does the block move immediately, because it has a transition?
With hover, the axis class works as it should. hover
example

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Spirin, 2018-02-07
@DotDash

transition works when you change a property. On the hover example :

.class {
  color: red;
  transform: translateY(-100%);
  transition: all 1s;
}

.class:hover {
  color: blue;
  transform: translateY(-50%);
}

When hovering over the .class element, the color will fade from red to blue and translateY from -100% to -50% within a second.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question