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

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

相关推荐
胡萝卜术2 小时前
力扣5. 最长回文子串
前端·javascript·面试
叩码以求索2 小时前
三维建模:SolidWorks 2025保姆级下载与安装教程指南
学习·数学建模
我星期八休息2 小时前
网络编程—应用层HTTP协议
linux·运维·开发语言·前端·网络·网络协议·http
不好听6132 小时前
前端路由完全指南(下篇):懒加载、History 栈与工程化实践
前端·react.js
zhangrelay4 小时前
消费电子原装锂电池服役8–20年且健康度>40%公开实测案例完整调研分析报告
笔记·学习
tyqtyq224 小时前
HarmonyOS AI 应用开发实战:简历项目经历改写系统
人工智能·学习·华为·生活·harmonyos
圣光SG4 小时前
Java Web入门基础知识笔记
java·前端·笔记
cyforkk5 小时前
Vercel 绑定自定义域名极简配置指南
服务器·前端·网络
IT_陈寒7 小时前
React useEffect依赖数组中埋的坑,这次终于让我逮到了
前端·人工智能·后端