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

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

相关推荐
lhh_qrsly3 小时前
HTTP / HTTPS / MQTT / MQTTs(嵌入式学习版)
学习·http·https
剪刀石头布啊9 小时前
vue-react为何要虚拟dom
前端
剪刀石头布啊9 小时前
ahooks常用的一些库,我们使用一下
前端
剪刀石头布啊9 小时前
从git更新本地提交记录到更新已经推送到远端记录
前端
Flynt11 小时前
axios 被投毒半年后,我把 npm 的"安全防线"实测了一遍:最信任的 SHA512 是安慰剂
前端·npm·node.js
excel11 小时前
Base62 和 Base64 有什么区别?
前端
风骏时光牛马13 小时前
大模型底层架构与AI源码深度剖析
前端
掘金挖土14 小时前
前端手摸手跑路之 AI 应用开发(九)
前端·后端
中文呀16 小时前
三维 GIS 离线缓存实战:逆向 CesiumOfflineCache,并亲手为它补上"自动更新"能力
前端