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

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

相关推荐
曲折5 分钟前
Cesium-气象要素PNG色斑图叠加
前端·cesium
Forever7_13 分钟前
Electron 淘汰!新的桌面端框架 更强大、更轻量化
前端·vue.js
Angelial23 分钟前
Vue3 嵌套路由 KeepAlive:动态缓存与反向配置方案
前端·vue.js
jiayu1 小时前
Angular学习笔记24:Angular 响应式表单 FormArray 与 FormGroup 相互嵌套
前端
jiayu1 小时前
Angular6学习笔记13:HTTP(3)
前端
小码哥_常1 小时前
Kotlin抽象类与接口:相爱相杀的编程“CP”
前端
evelynlab1 小时前
Tapable学习
前端
LeeYaMaster1 小时前
15个例子熟练异步框架 Zone.js
前端·angular.js
evelynlab1 小时前
打包原理
前端
拳打南山敬老院2 小时前
Context 不是压缩出来的,而是设计出来的
前端·后端·aigc