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

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

相关推荐
hellokatewj9 分钟前
React Hooks 全解:原理、API 与应用场景
前端·javascript·react.js
Qhumaing14 分钟前
C++学习:【PTA】数据结构 7-2 实验6-2(图-邻接表)
数据结构·c++·学习
袋鱼不重16 分钟前
保姆级教程:让 Cursor 编辑器突破地区限制,正常调用大模型(附配置 + 截图)
前端·后端·cursor
bieao18 分钟前
Vite+Antd+Micro-app中iframe模式下样式闪烁的问题
前端
zhouzhouya21 分钟前
码上星辰,人间烟火:我的2025
前端·程序员·代码规范
好奇龙猫25 分钟前
【日语学习-日语知识点小记-日本語体系構造-JLPT-N2前期阶段-第一阶段(1):再次起航】
学习
wdfk_prog29 分钟前
[Linux]学习笔记系列 -- [fs]sysfs
linux·笔记·学习
彭涛36129 分钟前
什么是MessageChannel
前端
嘉琪00138 分钟前
provide 和 inject的理解?
前端·javascript·vue.js
匆叔40 分钟前
ESLint,前端项目CTRL+S,自动保存格式化文档,超细
前端