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

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

相关推荐
知识分享小能手9 分钟前
MongoDB入门学习教程,从入门到精通,在生产环境中设置MongoDB(21)
数据库·学习·mongodb
L.fountain11 分钟前
图像自回归生成(Auto-regressive image generation)实战学习(六)
学习·数据挖掘·回归
chxii20 分钟前
在 IIS 中实现 SSL 证书的自动续期
前端
周星星日记27 分钟前
vue3中静态提升和patchflag实现
前端·vue.js·面试
weixin_4434785131 分钟前
Flutter组件学习之图表
学习·flutter·信息可视化
橘子编程34 分钟前
React 19 全栈开发实战指南
前端·react.js·前端框架
DanCheOo35 分钟前
AI Streaming 架构:从浏览器到服务端的全链路流式设计
前端·agent
我是小趴菜41 分钟前
前端如何让图片、视频、pdf等文件在浏览器直接下载而非预览
前端
cg331 小时前
开源项目自动化:用 GitHub Actions 让每个 Issue 都被温柔以待
前端
倦王1 小时前
大模型学习2
学习