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

效果图

源代码

HTML部分

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部分

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);
}
相关推荐
颜酱4 小时前
CLI 工具开发的常用包对比和介绍
前端·javascript·node.js
Chen不旧4 小时前
关于用户权限的设计,前端和后端都需要考虑
前端·权限
DsirNg4 小时前
前端和运维的哪些爱
前端
7***31884 小时前
Go-Gin Web 框架完整教程
前端·golang·gin
FinClip4 小时前
FinClip助力银行整合多个App,打造一站式超级应用
前端
火柴就是我4 小时前
从头写一个自己的app
android·前端·flutter
FinClip4 小时前
小程序如何一键生成鸿蒙APP?FinClip助力企业快速布局Harmony OS生态
前端
月下点灯4 小时前
🔄记住这张图,脑子跟着浏览器的事件循环(Event Loop)转起来了
前端·javascript·浏览器
邹小邹-AI5 小时前
Rust + 前端:下一个十年的“王炸组合”
开发语言·前端·rust
行走在顶尖5 小时前
vue3+ant-design-vue
前端