在 CSS min-width 上执行动画
如需在 CSS 中的 min-width 属性上实现动画,请尝试运行以下代码
示例
<!DOCTYPE html> <html> <head> <style> div { overflow: auto; width: 50%; background-color: blue; color: white; border: 1px solid black; animation: myanim 3s infinite; } @keyframes myanim { 30% { min-width: 550px; } } </style> </head> <body> <h1>Example of min-width</h1> <div> <p>This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. </p> </div> </body> </html>
广告