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

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

相关推荐
Mintopia6 分钟前
B 样条曲线:计算机图形学里的 “曲线魔术师”
前端·javascript·计算机图形学
前端小巷子9 分钟前
跨域问题解决方案:CORS(跨域资源共享)
前端·网络协议·面试
大大。10 分钟前
van-tabbar-item选中active数据变了,图标没变
java·服务器·前端
Mintopia12 分钟前
Three.js 3D 世界中的噪声运动:当数学与像素共舞
前端·javascript·three.js
nc_kai12 分钟前
Flutter 之 每日翻译 PreferredSizeWidget
java·前端·flutter
来碗疙瘩汤15 分钟前
使用 Three.js 与 CSS3DRenderer 在 Vue3 中加载网页为 3D 模型
前端·javascript
满分观察网友z17 分钟前
富文本解析终极指南:从Quill到小程序,我如何用正则摆平所有坑?
前端
打野赵怀真17 分钟前
在TypeScript中装饰器有哪些应用场景?
前端·javascript
destinying19 分钟前
vite学习笔记
前端·javascript
LRH20 分钟前
JS基础 - 手写数组扁平化函数
前端·javascript