F
F
FlatUser2019-09-16 19:39:35
css
FlatUser, 2019-09-16 19:39:35

How to make smooth centering of a block using css?

I have a block that starts on the right of the page.
How to make its (automatic) centering smooth (as with applying transition) on pure css (i.e. no js)? If that's even possible..

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dubrovin, 2019-09-16
@FlatUser

1. Layout so that the block is centered
2. Hang animation on the block via keyframe, which at 0% moves the block to the right edge of the page through transformX, and at 100% returns it back.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question