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

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

相关推荐
沛沛老爹4 分钟前
从Web到AI:行业专属Agent Skills生态系统技术演进实战
java·开发语言·前端·vue.js·人工智能·rag·企业转型
棒棒的皮皮36 分钟前
【深度学习】YOLO学习教程汇总
深度学习·学习·yolo·计算机视觉
GGGG寄了40 分钟前
HTML——列表标签
前端·html5
HWL56791 小时前
显示器缩放和更改分辨率的区别
前端·css·vue.js·计算机外设·html5
詩不诉卿1 小时前
Zephyr学习之spi flash驱动记录(w25q128)
学习
jzshmyt1 小时前
曼德勃罗集web可视化应用
前端
GGGG寄了1 小时前
HTML——表格的基本用法
前端·html
yanyu-yaya1 小时前
速学兼复习之vue3章节3
前端·javascript·vue.js·学习·前端框架
web小白成长日记1 小时前
前端向架构突围系列模块化 [4 - 1]:思想-超越文件拆分的边界思维
前端·架构
tkevinjd1 小时前
3-Vue&Ajax
前端·vue.js·ajax