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

css实现优惠券样式

实现优惠券效果:

实现思路:

  1. 需要三个盒子元素,使用 css 剪裁,利用 ellipse 属性,将两个盒子分别裁剪成两个半圆,位置固定在另一个盒子元素左右两边适当位置上。
  2. 为另一个盒子设置想要的样式,圆角、背景颜色和中间的横虚线等,此处使用的是 uView
<template><view class="pages"><view class="clip1" /><view class="clip2" /><view class="pageChild"><view class="header"/><view class="line"><u-line dashed color="#fff" direction="row" length="96%" /></view><view class="body"/></view></view>
</template><script>
export default {data() {return {};},methods: {},
};
</script><style scoped lang="scss">
.pages {width: 95vw;position: relative;.clip1 {width: 100%;height: 100%;background-color: #fff;position: absolute;clip-path: ellipse(2% 6% at 0% 38%);}.clip2 {width: 100%;height: 100%;background-color: #fff;position: absolute;clip-path: ellipse(2% 6% at 100% 38%);}.pageChild {background-color: rgba($color: #ff0000, $alpha: 0.6);border-radius: 10rpx;.header {height: 85rpx;display: flex;justify-content:flex-start;align-items: center; }.line {display: flex;justify-content:center;align-items: center; }.body {height: 137rpx;display: flex;flex-direction: row;flex-wrap:wrap;}}
}
</style>
http://www.lryc.cn/news/370883.html

相关文章:

  • 函数递归(C语言)(详细过程!)
  • uniapp 接口请求封装
  • C++中的观察者模式
  • conda虚拟环境,安装pytorch cuda cudnn版本一致,最简单方式
  • 第 5 章:面向生产的 Spring Boot
  • 在 Windows 操作系统中,可以通过命令行工具来杀死进程
  • uni-app文件下载 h5 xls 乱码 锟斤拷 Blob pdf打不开
  • Vue25-内置指令02:v-text指令
  • stable diffusion中的negative prompt是如何工作的
  • STM32项目分享:智能小区充电桩系统
  • PDU模块中浪涌保护模块与空开模块的应用
  • 19、Go Gin框架集成Swagger
  • 自动同步库数据——kettle开发36
  • MSOCache在电脑中可以删除吗?
  • 数据网格和视图入门
  • 雨的轮回与生命的律动
  • CANopen for Python 使用教程(二)
  • 前方碰撞缓解系统技术规范(简化版)
  • 数据赋能(117)——体系:数据收集——实施过程、应用特点
  • 【吃包子game】
  • 图片转Base64
  • STM32项目分享:智能家居语音系统
  • iOS 18 为 iPhone 15 机型引入了更多充电限制选项
  • Linux文本三剑客 awk 和 grep
  • Python NumPy 库详解
  • React state 执行时机
  • Spring基于注解开发
  • 深度探索:智能家居背后的科技力量与伦理思考
  • 鸿蒙开发:通过startAbilityByType拉起垂类应用
  • docker 更换镜像源