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);
}
相关推荐
qq_4061761416 分钟前
JavaScript闭包:从底层原理到实战
开发语言·前端·javascript
冰暮流星16 分钟前
javascript之Math对象——绝对值,开次方,四舍五入
前端·javascript
啊啊啊啊懒19 分钟前
vite创建完项目之后vue文件中有标签报错
前端·javascript·vue.js
Knight_AL19 分钟前
从 bootstrap.yml 到 Config Data 的一次架构升级
前端·架构·bootstrap
共享家952727 分钟前
测试常用函数(下)
java·服务器·前端
问道飞鱼35 分钟前
【Rust开发知识】Actix-web 开发环境搭建完整教程
开发语言·前端·rust·actix-web
a1760293175736 分钟前
任天堂超级马里奥合集系列游戏130合1 解压即玩 天马G前端整合包附使用教程
前端·游戏·玩游戏·游戏机·单机游戏
雪忆·HL43 分钟前
CSS3知道这些就足够了
前端·css·css3
心机boy22943 分钟前
CSS3网格布局、过渡及2D效果
前端·javascript·css3
空白43 分钟前
自学HTML5+CSS3丨第三天丨详解SEO
前端·css3·html5