W3School TIY Editor
W3School 在线教程
改变方向
暗黑模式
运行代码
<!DOCTYPE html> <html> <head> <style> #myDIV { background-color: lightblue; border: 1px solid black; animation: mymove 5s infinite; } @keyframes mymove { 50% {padding-left: 50px;} } </style> </head> <body> <h1>padding-left 的动画效果:</h1> <p>逐渐将 padding-left 从 0px 改为 50px,然后再改回 0px:<p> <div id="myDIV"> Shanghai is one of the four direct-administered municipalities of the People's Republic of China. Welcome to Shanghai!... </div> <p><b>注释:</b>CSS 动画在 Internet Explorer 9 以及更早版本中不起作用。</p> </body> </html>