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>
相关推荐
mCell5 小时前
使用 useSearchParams 同步 URL 和查询参数
前端·javascript·react.js
mCell6 小时前
前端路由详解:Hash vs History
前端·javascript·vue-router
海上彼尚6 小时前
无需绑卡的海外地图
前端·javascript·vue.js·node.js
1024肥宅7 小时前
手写 call、apply、bind 的实现
前端·javascript·ecmascript 6
科杰智能制造8 小时前
纯前端html、js实现人脸检测和表情检测,可直接在浏览器使用
前端·javascript·html
每天吃饭的羊8 小时前
组件库的有些点击事件是name-click这是如何分装de
前端·javascript·vue.js
x***01068 小时前
SpringSecurity+jwt实现权限认证功能
android·前端·后端
1024肥宅8 小时前
防抖(Debounce)
前端·javascript·ecmascript 6
1024肥宅8 小时前
节流(Throttle)
前端·javascript·ecmascript 6
大怪v8 小时前
【Virtual World 02】两点一线!!!
javascript·css·html