CSS3动画方式增加线条长度
分类:实例代码
CSS3动画方式增加线条长度属于前端实例代码,有关更多实例代码大家可以查看。
分享一段代码实例,它以动画方式增加线条的长度。
代码实例如下:
<!doctype html> <html> <head> <meta charset="utf-8"> <meta name="author" content="http://www.pipipi.net/" /> <title>前端教程网</title> <style> .box { height: 2px; background: #000; animation: width 3s linear infinite alternate; } @keyframes width { from { width: 0px; } to { width: 100%; } } </style> </head> <body> <div class="box"></div> </body> </html>
上面的代码实现了我们的要求,更多内容参阅相关阅读。
相关阅读:
(1).animation属性参阅CSS3 animation一章节。
(2).@keyframes参阅CSS3 @keyframes一章节。
CSS3动画方式增加线条长度,这样的场景在实际项目中还是用的比较多的,关于CSS3动画方式增加线条长度就介绍到这了。