<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Document</title> <style> p{text-align:center;font-weight: bold; transition: all 1s ease .3s; animation:play 3s ease .3s; animation-fill-mode: forwards} @keyframes play{ 0%{transform: translate(0,0) rotate(0)} 100%{transform: translate(200px,300px) rotate(60deg)} } p:hover{transform:rotate(40deg)} </style> </head> <body> <p>你好</p> </body> </html>
transition不起作用,把animation动画去掉,transition动画就有效,怎样让两者都有效。(在chrome下测试的,不是兼容性问题)