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;
    }

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

相关推荐
2501_918126911 小时前
stm32做一个次声波检测器,需要哪些元件
stm32·单片机·嵌入式硬件·学习·个人开发
GocNeverGiveUp1 小时前
大模型学习2-Agent
学习
Bal炎魔2 小时前
AI 学习专题一,AI 实现的原理
人工智能·学习
万物得其道者成2 小时前
前端大整数精度丢失:一次踩坑后的实战解决方案(`json-bigint`)
前端·json
鹏北海2 小时前
移动端 H5 响应式字体适配方案完全指南
前端
Ro Jace2 小时前
分岔机制学习
人工智能·学习·机器学习
反向跟单策略3 小时前
期货反向跟单-2025年回顾及2026年展望
大数据·人工智能·学习·数据分析·区块链
yunhuibin4 小时前
GoogLeNet学习
人工智能·python·深度学习·神经网络·学习
柳杉4 小时前
使用AI从零打造炫酷医疗数据可视化大屏,源码免费拿!
前端·javascript·数据可视化
凌云拓界4 小时前
前端开发的“平衡木”:在取舍之间找到最优解
前端·性能优化·架构·前端框架·代码规范·设计规范