纯css实现导航条底部动画效果
代码语言:html
所属分类:菜单导航
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>CodePen - Reverse Direction Underline Hover Effect</title> <style> * { color: white; } .container { background-color: black; width: 100%; height: 100vh; display: flex; justify-content: center; align-items: center; } ul { list-style: none; padding: 0; display: flex; flex-flow: row wrap; } li { padding: 1rem 2rem; } a { text-decoration: none; position: relative; color: black; font-size: 2rem; font-weight: 900; padding: 8px 0; } .underline::after { content: ""; border-bottom: solid 4px white; position: absolute; bottom: 0; left: 0; width: 100%; -webkit-transform: scaleX(0); transform: scaleX(0); -webkit-transform-origin: right; transform-origin: right; transition: -webkit-transform 0.25s; transition: transform 0.25s; transition: transform 0.25s, -webkit-transform 0.25s; } .underline:hover::after { -webkit-transform-origin: left; transform-origin: left; -webkit-transfo.........完整代码请登录后点击上方下载按钮下载查看
网友评论0