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

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

相关推荐
用泥种荷花17 小时前
从 0 到 1 做一个支持 NFC 写入的小程序,需要哪些 API?
前端
90程序员17 小时前
纯浏览器解析 APK 信息,不用服务器 | 开源了一个小工具
前端·apk
用户114818678948417 小时前
Vosk-Browser 实现浏览器离线语音转文字
前端·javascript
江上清风山间明月17 小时前
Vite现代化的前端构建工具详解
前端·webpack·nodejs·vite
PBitW17 小时前
apijson 让前端自己定义接口 —— 但不推荐
前端·apijson
存在X17 小时前
前端自动化编译Jenkins
前端·github
军军君0117 小时前
数字孪生监控大屏实战模板:云数据中心展示平台
前端·javascript·vue.js·typescript·前端框架·es6·echarts
吴声子夜歌17 小时前
Vue3——使用axios实现Ajax请求
前端·javascript·ajax·axios
光影少年17 小时前
Python+LangGraph学习路线及发展前景
开发语言·人工智能·python·学习
qq43569470117 小时前
JavaWeb05
前端·html