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>
相关推荐
Csvn2 分钟前
渲染管线
前端
程序员大阳15 分钟前
副队长CSS教程(33)–圆角与透明
前端·css·透明·圆角
志尊宝25 分钟前
Vue3 零基础每日笔记(082):文件上传实战——el-upload 校验、自定义上传、头像预览
前端·javascript·vue.js·笔记·#javascript·#vue.js
鬼手点金1 小时前
opencode-rules 插件
java·开发语言·前端·人工智能·chrome·git·github
柳杉1 小时前
借助 Codex 和可视化工作流,从调研到完整实现,3D 大屏竟然可以这么简单
前端·ai编程·数据可视化
IMPYLH1 小时前
HTML 的 <wbr> 元素
前端·html
Dovis(誓平步青云)2 小时前
常用命令藏得太深?怎么做一个快捷命令坞
运维·前端·自动化·音视频·prometheus
IT_陈寒3 小时前
Vite的这个问题坑了我三天,原来如此解决!
前端·人工智能·后端
网易云信3 小时前
大模型能上岗做销售吗?我们让 12 款国产模型交了 420 份作业
前端·后端
蜗牛互联网3 小时前
Python Agent工具调用的白名单、参数校验与审批门禁
java·服务器·前端·人工智能·后端·python