Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS transform-translate isn't working with animation

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #266047
    drissboumlik
    Participant

    Hi everyone
    I write this code
    https://codepen.io/drissboumlik/full/JMgZXj/
    and i’ve noticed that the transform isn’t working until i remove the animation

    #266048
    bearhead
    Participant

    The transforms in the animation are overriding the transform on the div. I’d recommend wrapping the spinner div in parent div, and then translate the parent div.

    Or if you need to do it with a single element, use two animations. One for the div and another for the :before and :after pseudo elements. On the animation for the div, add the translate to each keyframe.

    #266056
    drissboumlik
    Participant

    thank u, i fixed it

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘CSS’ is closed to new topics and replies.