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

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

相关推荐
组合缺一3 分钟前
Solon AI 开发学习16 - generate - 生成模型(图、音、视)
java·人工智能·学习·ai·llm·solon
真上帝的左手8 分钟前
24. 前端-js框架-Electron
前端·javascript·electron
毛发浓密的女猴子13 分钟前
Git Pull 策略完全指南:Merge、Rebase、Fast-forward 深度对比
前端
夏小花花14 分钟前
<editor> 组件设置样式不生效问题
java·前端·vue.js·xss
PieroPC15 分钟前
用 nicegui 3.0 + sqlite3 做个简单博客
前端·后端
weixin_3077791315 分钟前
Jenkins Ioncions API 插件:现代化图标库在持续集成中的应用
java·运维·开发语言·前端·jenkins
兔子零102416 分钟前
零硬件交互:如何用纯前端把摄像头变成 4000 个粒子的魔法棒?
前端·算法
北辰alk16 分钟前
Vue Router 组件内路由钩子全解析
前端·vue.js
克喵的水银蛇20 分钟前
Flutter 弹性布局实战:Row/Column/Flex 核心用法与优化技巧
前端·javascript·typescript
Mr_Hu40420 分钟前
鸿蒙开发学习笔记-生命周期小记
笔记·学习·harmonyos·鸿蒙