search

Home  >  Q&A  >  body text

html - css Why do I add translate3d(0,0,0) when the element disappears under hover?

figure.team-blue:hover img{
  opacity: 0;
  -webkit-transform: translate3d(0,0,0);
  transform: translate3d(0,0,0);
}
女神的闺蜜爱上我女神的闺蜜爱上我2765 days ago970

reply all(2)I'll reply

  • 迷茫

    迷茫2017-06-27 09:21:01

    Adding translate3d(0,0,0) should be to enable hardware acceleration (hack technique), and the disappearing effective code should be the sentence opacity: 0;.

    reply
    0
  • 阿神

    阿神2017-06-27 09:21:01

    Using -webkit-transform: translate3d(0,0,0); will kick the GPU into action for the CSS transitions, making them smoother (higher FPS). Probably means using hardware acceleration

    reply
    0
  • Cancelreply