A
A
Alexey Nikolaev2015-10-30 01:41:08
css
Alexey Nikolaev, 2015-10-30 01:41:08

Is it possible to combine transform (no animation) with animation?

Goodnight.
An example is here . I'm trying to center an element vertically and then rotate it. The difficulty is that the first transform is not applied when the animation is on, and since the element can be of a random height, this is the best centering option of all. How to be? ..
Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nikolay Talanov, 2015-10-30
@Heian

You know the element's height, so why are you trying to center it with translateY(-50%)? Use a negative margin-top for half the height of the element and that's it. In general, centering elements using transforms is an extremely unreliable thing, because on odd values ​​you will get garbage due to half-pixel rendering.

W
wildsnail, 2015-11-06
@wildsnail

Is this the result you wanted to achieve?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question