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

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

相关推荐
VaJoy28 分钟前
全面革新⚡️ Vue 3.6 项目工程的基础实现
前端·vue.js
苍何42 分钟前
耗时 7 天,我们开源了腾讯 WorkBuddy 实战蓝皮书(建议收藏)
前端·后端
~kiss~1 小时前
LLM 的 层归一化(稳定训练) - Layer Normalization & RMSNorm
学习
MartinYeung51 小时前
[论文学习]LLM-based AI Agent 安全威胁与防御系统性综述
人工智能·学习·安全
大家的林语冰1 小时前
😭 Electron 麻了,Deno 直接支持二进制应用,无需第三方桌面应用框架!
前端·javascript·node.js
Damai2 小时前
DOMPurify 完整介绍
前端·面试
随风一样自由2 小时前
【前端+跨域】跨域问题全面解析与解决方案指南
前端·跨域
巴巴媛6662 小时前
STM32学习笔记【36.CAN收发实验】
笔记·stm32·学习
小帅不太帅2 小时前
我随手发了几张截图,白拿了一个月 AI 顶配会员
前端·github
36岁的我开始学习打篮球2 小时前
外规内化技术架构
前端