1、css3 动态button展示学习

效果图:

1、首先创建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>
<body>
    <button>关注我</button>
</body>
</html>

2、展示css3代码:

css 复制代码
button{
        width: 120px;
        height: 38px;
        background-color: transparent;
        color: #000;
        border: none;
        border-radius: 5px;
        cursor: pointer;
        font-size: 20px;
        font-weight: 600;
        font-family: Arial, Helvetica, sans-serif;
        box-sizing: border-box;
        position: relative;
        transition: all 0.6s ease-in-out;
    }
    button:after{
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 1px;
        height: inherit;
        background-color: #333;
        z-index: -1;
        transition: all 0.6s ease-in-out;
    }
    button:hover{
        color: aliceblue;
        cursor: pointer;
    }
    button:hover:after{
        width: 100%;
        border-radius: 6px;
    }

本人也是学习阶段,希望能够一起学习,高手请留余地勿喷。

相关推荐
MarkHD4 小时前
智能体在车联网中的应用:第51天 模仿学习与离线强化学习:破解数据效率与安全困局的双刃剑
学习·安全
wearegogog1237 小时前
基于 MATLAB 的卡尔曼滤波器实现,用于消除噪声并估算信号
前端·算法·matlab
Drawing stars7 小时前
JAVA后端 前端 大模型应用 学习路线
java·前端·学习
崇山峻岭之间7 小时前
Matlab学习记录33
开发语言·学习·matlab
品克缤7 小时前
Element UI MessageBox 增加第三个按钮(DOM Hack 方案)
前端·javascript·vue.js
小二·7 小时前
Python Web 开发进阶实战:性能压测与调优 —— Locust + Prometheus + Grafana 构建高并发可观测系统
前端·python·prometheus
小沐°7 小时前
vue-设置不同环境的打包和运行
前端·javascript·vue.js
科技林总8 小时前
【系统分析师】3.5 多处理机系统
学习
qq_419854058 小时前
CSS动效
前端·javascript·css
烛阴8 小时前
3D字体TextGeometry
前端·webgl·three.js