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

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

相关推荐
动词ing10 分钟前
【学习笔记】51单片机 模块化编程
笔记·学习·51单片机
Ramble_Naylor16 分钟前
Rust深度解读:高性能 Web 网关与 Axum 架构剖析
前端·架构·rust
程序员飞哥17 分钟前
AI 编程额度怎么用才不浪费?
java·前端·后端
柳杉18 分钟前
用 Codex 魔改卡神开源的 AIHOT,我做了个 3D 技术雷达
前端·aigc
王亚博_Abel20 分钟前
AI 编程时代怎么选前端框架?同一个应用让 Agent 用 12 种框架各写 5 遍,我整理出这套选型方法
前端·人工智能·前端框架
不在逃避q23 分钟前
Chrome 扩展安全攻防实录:从攻击面到防御实践
前端·chrome·安全
砚凝霜26 分钟前
保姆级 | CTF Lemon:禁用右键/F12 怎么破?查看源码 + HTML 注释拿 flag
前端·html
海绵宝宝转agent30 分钟前
计网基础知识
网络·笔记·学习·智能路由器
IT_陈寒33 分钟前
Vite开发实战:从入门到精通
前端·人工智能·后端
普通人636 分钟前
Web端3D模型加载实战指南_Vue3_uni-app_HTML
前端·javascript·uni-app·html