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);
}
相关推荐
CDN3609 分钟前
【前端进阶】告别“慢”与“不安全”:我是如何用360CDN搞定API加速和HTTPS的
前端·安全·https
Rabbit码工10 分钟前
HTML5 与 CSS3 新特性全解析:从结构优化到视觉升级
前端·css·css3·html5
王美丽1.8510 分钟前
css3选择器
前端·css·css3
噜噜薯10 分钟前
HTML5和CSS3的核心新增特性及其语法
前端·css3·html5
.Cnn14 分钟前
Ajax与Vue 生命周期核心笔记
前端·javascript·vue.js·笔记·ajax
王铁柱66616 分钟前
使用css3如何对动画进行延时操作?
前端·css·css3
海风总是软软的16 分钟前
CSS3伪类选择器详解
前端·css3
心易行者20 分钟前
代码写好了,然后呢?——手把手教你把Python脚本变成能赚钱的Web应用
开发语言·前端·python
程序员蓝莓21 分钟前
别再花钱买HTTPS证书了!永久免费自动更新证书-Let's Encrypt。三步无脑安装。
前端
LinHan23 分钟前
功能区代码块一直不能优雅折叠?2026年,我终于用这个 VS Code 插件解决了
前端