当前位置: 首页 > article >正文

好玩的css按钮

预览效果

源码

<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="utf-8">
    <title>渐隐式按钮</title>
    <style>
        .app {
            width: 100%;
            height: 100vh;
            background-color: #fff;
            position: relative;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .macaron-btn {
            width: 120px;
            height: 48px;
            font-size: 16px;
            font-weight: bold;
            color: #fff;
            letter-spacing: 2px;
            position: relative;
            border: none;
            outline: none;
            background-color: #87CEFA; /* 马卡龙浅蓝色 */
            border-radius: 7px;
            cursor: pointer;
            box-shadow: 0 0 0 4px #6495ED; /* 较深的马卡龙蓝色 */
            transition: all 0.1s linear;
        }

        .macaron-btn:after {
            content: '按钮哦~';
            width: 100%;
            font-size: 16px;
            font-weight: bold;
            color: #6495ED; /* 较深的马卡龙蓝色 */
            letter-spacing: 2px;
            position: absolute;
            left: 0;
            opacity: 1;
            transition: all 0.3s linear;
        }

        .macaron-btn:hover:after {
            opacity: 0;
            transform: translateY(-20px);
        }

        .macaron-btn:active {
            transform: scale(0.99);
            box-shadow: 0 0 0 2px #6495ED; /* 较深的马卡龙蓝色 */
        }
    </style>
</head>

<body>
    <div class="app">
        <button class="macaron-btn">按钮哦~</button>
    </div>
</body>

</html>


http://www.kler.cn/news/350681.html

相关文章:

  • 听见文本的魅力:AI 与未来的语音交互
  • 算法革新决定未来!深挖数字北极星3.0背后的技术逻辑
  • 海港[NOIP2016]
  • 【Flutter】页面布局:线性布局(Row 和 Column)
  • 飞睿智能超宽带UWB音频传输模块,超低延迟数据传输,实时音频声音更纯净
  • 用 Vue 打造高效 Gherkin 自动化测试脚本编写工具
  • 关于 GLFW、SDL2、Win32、GLUT 和 macOS(OSX)平台的介绍
  • UDP/TCP协议详解
  • Git 分支操作-开发规范
  • 条款2 理解auto类型的推导
  • 如何通过 Service Mesh 构建高效、安全的微服务系统
  • FFmpeg的简单使用【Windows】--- 视频倒叙播放
  • 一文详解线程池
  • R语言统计分析——折线图
  • 【uniapp】实现触底加载数据
  • Linux实验三
  • MySQL 数据库--查询
  • 《数据之海》
  • LeetCode 第419场周赛个人题解
  • Spring Boot在医疗病历B2B交互中的技术突破
  • 设计模式和软件框架的关系
  • 【优先算法】--双指针1
  • 【二刷hot-100】day1
  • 家政行业小程序需要哪些功能?
  • STM32—旋转编码器控制直流电机(标准库)
  • Luminar Neo v1.21.0.13934 图像编辑软件绿色便携版