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

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

相关推荐
lifewange19 分钟前
UI自动化页面元素定位有几种方式
前端·ui·自动化
牛奶34 分钟前
2026 春涧·前端走向全栈
前端·人工智能·全栈
Piper蛋窝35 分钟前
AI 有你想不到,也它有做不到 | 2025 年深度使用 Cursor/Trae/CodeX 所得十条经验
前端·后端·代码规范
LYFlied1 小时前
WebAssembly为何能实现极致性能:从设计原理到执行优势
前端·wasm·跨端
释怀不想释怀2 小时前
vue布局,动态路由
前端·html
桜吹雪2 小时前
Vue 基础:状态管理入门
前端·vue.js
JavaGuide3 小时前
利用元旦假期,我开源了一个大模型智能面试平台+知识库!
前端·后端
yuanyxh3 小时前
程序设计
前端·设计
今天也好累3 小时前
C语言安全格式化:snprintf核心指南
c语言·笔记·学习·visual studio
eason_fan4 小时前
前端性能优化利器:LitePage 轻量级全页设计解析
前端·性能优化·前端工程化