CSS通用优惠券样式

样式如图:

这么点模块css还挺多的,写个demo方便CV

html 复制代码
<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>通用优惠券样式</title>
    <style>
      body {
        padding: 20px;
        display: flex;
        justify-content: center;
        align-items: center;
      }

      .coupon-card {
        display: flex;
        width: 100%;
        max-width: 350px;
        background-color: #fff;
        border-radius: 12px;
        overflow: hidden;
        border: 1px solid red;
      }

      .coupon-left {
        width: 25%;
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 15px;
        border-right: 1px dashed #e8e8e8;
      }

      .coupon-image {
        width: 60px;
        height: 60px;
        border: 1px solid green;
      }

      .coupon-middle {
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        width: 50%;
        padding: 15px 12px;
        border-right: 1px dashed #e8e8e8;
      }

      .coupon-title {
        max-width: 140px;
        font-size: 14px;
        font-weight: 500;
        color: #333;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
      }

      .coupon-condition {
        font-size: 12px;
        color: #999;
      }

      .coupon-right {
        width: 25%;
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 15px;
      }

      .use-button {
        background-color: #1890ff;
        color: white;
        border: none;
        border-radius: 16px;
        padding: 6px 12px;
        font-size: 12px;
        cursor: pointer;
      }
    </style>
  </head>
  <body>
    <div class="coupon-card">
      <div class="coupon-left">
        <img
          class="coupon-image"
          src="https://picsum.photos/200/300?random=1"
        />
      </div>

      <div class="coupon-middle">
        <div class="coupon-title">神州租车2天满减券州租车</div>
        <div class="coupon-condition">限指定商品可用</div>
      </div>

      <div class="coupon-right">
        <button class="use-button">去使用</button>
      </div>
    </div>
  </body>
</html>
相关推荐
陈随易3 小时前
Postman 被曝自动往 Claude Code 和 Codex 装插件
前端·后端·程序员
Csvn6 小时前
性能监控
前端
Csvn6 小时前
构建工具
前端
FRing037 小时前
vue2干货总结3(computed计算属性、watch监听器)
开发语言·前端·vue.js·vue2
kyriewen9 小时前
Skills 榜前 10 我全装了:只有 3 个能直接用
前端·javascript·程序员
IT_陈寒9 小时前
当Java的hashCode遇上Lombok,我的缓存被全清了
前端·人工智能·后端
工控丫丫10 小时前
帆软看板中经常使用的公式函数及经常搭的组合
前端·javascript·数据库
jerrywus10 小时前
我用 GPT-6.1-sol 做了台会讲解的 3D 售货机:60 罐饮料,一口没喝上
前端·agent·claude
孟陬12 小时前
Foobar 技术周刊#159:当看不懂代码时,如何高效排障调试。脏页陷阱:一条只读查询,写入数 TB 数据。推测解码:大模型加速利器
前端·人工智能·后端
Zhao-Jichao12 小时前
AI Prompting for Everyone 课程笔记 - P17 图像生成 Imaging Generation
前端