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

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

相关推荐
爱吃苹果的日记本1 小时前
数据结构第三课(时间复杂度)
数据结构·学习
几何心凉2 小时前
没有万能模型:我用 AiiOnly Token Plan,把多款大模型的长处拼进同一个项目
前端
kyriewen2 小时前
Claude Code 的额度今天缩水了17%——官方公告上写的是"永久提高25%"
前端·ai编程·claude
雪芽蓝域zzs3 小时前
vue解构平铺VS对象包裹
前端·javascript·vue.js
风骏时光牛马4 小时前
从零到实战,完整AI学习路线
前端
泡泡鱼(敲代码中)4 小时前
MySQL基础学习笔记:从数据模型到DDL全掌握
开发语言·数据库·笔记·学习·mysql
三十而立洋4 小时前
深入理解 Monorepo:子包安装依赖
前端·前端工程化
IT_陈寒4 小时前
Java Stream处理大集合,我的内存怎么就炸了
前端·人工智能·后端
Captaincc5 小时前
AI 用量桌面端-桌面宠物自定义指南
前端·人工智能
OpenTiny社区5 小时前
码力全开,智启前端新生态|OpenTiny 登陆华为全联接大会2026
前端·github