欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 科技 > 名人名企 > web前端动画按钮(附源代码)

web前端动画按钮(附源代码)

2025/4/25 16:29:28 来源:https://blog.csdn.net/2301_81704123/article/details/143693330  浏览:    关键词:web前端动画按钮(附源代码)

效果图

源代码

HTML部分

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Document</title>
</head>
<link rel="stylesheet" href="..\暑假学习网页小零件\按钮2.css">
<body>
<a href="">爱莉希雅</a>
<a href="">爱莉希雅</a>
<a href="">爱莉希雅</a></body>
</html>

css部分

*{margin: 0;padding: 0;box-sizing: border-box;
}
body{display: flex;justify-content: center;align-items: center;gap: 100px;background-color: black;min-height: 100vh;
}
a{position: relative;padding: 10px 50px;margin: 45px 0;color:pink;text-decoration: none;font-size: 25px;font-family: 'Times New Roman', Times, serif;overflow: hidden;transition: all 0.4s;-webkit-box-reflect: below 1px linear-gradient(transparent,#0003);}
a::before{position: absolute;content: "";top: 0;left: 0;border-left: 3px solid pink;border-top: 3px solid pink;width: 20px;height: 15px;transition: all 0.5s;
}
a::after{position: absolute;content: "";bottom: 0;right: 0;border-right: 3px solid pink;border-bottom: 3px solid pink;width: 20px;height: 15px;transition: all 0.5s;
}
a:hover::before,
a:hover::after{width: 100%;height: 100%;
}
a:hover{background-color: pink;color: black;box-shadow: 0 0 pink;transition-delay: 0.5s;
}
/* 选择父元素下特定的位置,可以是数字,odd(奇数),even(偶数)或者表达式。 */
a:nth-child(1){   /* 滤镜 */filter: hue-rotate(150deg);
}
a:nth-child(3)
{filter: hue-rotate(280deg);
}

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

热搜词