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);
}
相关推荐
视频砖家31 分钟前
移动端Html5播放器按钮变小的问题解决方法
前端·javascript·viewport功能
lyj1689971 小时前
vue-i18n+vscode+vue 多语言使用
前端·vue.js·vscode
小白变怪兽2 小时前
一、react18+项目初始化(vite)
前端·react.js
ai小鬼头2 小时前
AIStarter如何快速部署Stable Diffusion?**新手也能轻松上手的AI绘图
前端·后端·github
墨菲安全3 小时前
NPM组件 betsson 等窃取主机敏感信息
前端·npm·node.js·软件供应链安全·主机信息窃取·npm组件投毒
GISer_Jing3 小时前
Monorepo+Pnpm+Turborepo
前端·javascript·ecmascript
天涯学馆3 小时前
前端开发也能用 WebAssembly?这些场景超实用!
前端·javascript·面试
我在北京coding4 小时前
TypeError: Cannot read properties of undefined (reading ‘queryComponents‘)
前端·javascript·vue.js
前端开发与ui设计的老司机5 小时前
UI前端与数字孪生结合实践探索:智慧物流的货物追踪与配送优化
前端·ui
全能打工人5 小时前
前端查询条件加密传输方案(SM2加解密)
前端·sm2前端加密