时间:2021-07-01 10:21:17 帮助过:17人阅读
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>鼠标移入下划线展开</title> <style type="text/css"> #underline{ width: 200px; height: 50px; background: #ddd; margin: 20px; position: relative; } #underline:after{ content: ""; width: 0; height: 1px; background: blue; position: absolute; top: 100%; left: 50%; transition: all .8s; } #underline:hover:after{ left: 0%; width: 100%; } </style> </head> <body> <p id="underline"></p> </body> </html>
相关推荐:
以上就是代码实现css鼠标经过元素下划线两边展开效果的详细内容,更多请关注Gxl网其它相关文章!