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);
}
相关推荐
用户81274828151205 分钟前
安卓Settings值原理源码剖析存储最大的字符数量是多少?
前端
用户81274828151208 分钟前
安卓14剖析SystemUI的ShadeLogger/LogBuffer日志动态控制输出dumpsy机制
前端
Ankkaya11 分钟前
cloudflare + github 实现留言板
前端·github
是你的小橘呀11 分钟前
单页应用路由怎么搞?React Router 从原理到实战全解析!
前端·javascript
xuedaobian12 分钟前
2025年我是怎么用AI写代码的
前端·程序员·ai编程
风止何安啊12 分钟前
Set/Map+Weak三剑客的骚操作:JS 界的 “去重王者” ,“万能钥匙”和“隐形清洁工”
前端·javascript·面试
saberxyL12 分钟前
前端登录加密与Token管理实践
前端
3秒一个大16 分钟前
React 中 Context 的作用与用法:从主题切换案例说起
前端·react.js
2501_9444460024 分钟前
Flutter&OpenHarmony文本输入组件开发
前端·javascript·flutter
AI前端老薛30 分钟前
你了解react合成事件吗
前端·react.js·前端框架