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

带有渐变光晕

<!DOCTYPE html>
<html lang="zh-CN">
<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>最终版无缝边框 Demo</title><style>html {font-size: 16px;}body {font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;display: flex;justify-content: center;align-items: center;min-height: 100vh;margin: 0;padding: 20px;box-sizing: border-box;background-color: #f0f2f5;}.display-box {display: inline-flex;flex-direction: column;position: relative; min-width: 200px;max-width: 560px;min-height: 200px;max-height: 500px;background-color: #ffffff;border-radius: 8px; /* 圆角半径 */box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);/* 新增:隐藏超出容器的部分,用于裁剪光晕 */overflow: hidden;}.display-box::before {content: '';position: absolute;inset: 0;border-radius: inherit;pointer-events: none;/* 新增:提升边框层级 */z-index: 2;background: red;-webkit-mask:linear-gradient(to right, white, transparent) top 0 left 6px / calc(33.33% - 6px) 1px no-repeat,linear-gradient(to bottom, white, transparent) top 6px left 0 / 1px calc(33.33% - 6px) no-repeat,linear-gradient(to left, white, transparent) bottom 0 right 6px / calc(33.33% - 6px) 1px no-repeat,linear-gradient(to top, white, transparent) bottom 6px right 0 / 1px calc(33.33% - 6px) no-repeat,radial-gradient(circle at bottom right, transparent 7px, white 7px, white 8px, transparent 8px) top left / 8px 8px no-repeat,radial-gradient(circle at top left, transparent 7px, white 7px, white 8px, transparent 8px) bottom right / 8px 8px no-repeat;mask:linear-gradient(to right, white, transparent) top 0 left 6px / calc(33.33% - 6px) 1px no-repeat,linear-gradient(to bottom, white, transparent) top 6px left 0 / 1px calc(33.33% - 6px) no-repeat,linear-gradient(to left, white, transparent) bottom 0 right 6px / calc(33.33% - 6px) 1px no-repeat,linear-gradient(to top, white, transparent) bottom 6px right 0 / 1px calc(33.33% - 6px) no-repeat,radial-gradient(circle at bottom right, transparent 7px, white 7px, white 8px, transparent 8px) top left / 8px 8px no-repeat,radial-gradient(circle at top left, transparent 7px, white 7px, white 8px, transparent 8px) bottom right / 8px 8px no-repeat;}/* 修改:创建椭圆形光晕效果 */.display-box::after {content: '';position: absolute;/* 尺寸:椭圆形,宽度60%,高度40% */width: 60%;height: 0;padding-bottom: 40%; /* 使用padding-bottom技巧创建响应式椭圆形 *//* 定位到左下角 */left: 0;bottom: 0;/* 使用transform将椭圆中心向右移动30% */transform: translate(-20%, 50%);/* 创建椭圆形径向渐变光晕 */background: radial-gradient(ellipse at center, rgba(255, 0, 0, 0.25) 0%, transparent 70%);border-radius: 50%;}.display-box-content {padding: 1.25rem;padding-right: 2.5rem;box-sizing: border-box;overflow-y: auto;/* 新增:提升内容层级,使其位于光晕之上 */position: relative;z-index: 1;scrollbar-width: thin;scrollbar-color: #c1c1c1 #f1f1f1;}.title { font-size: 0.875rem; color: #303133; line-height: 1.5; white-space: nowrap; }.title .label { font-weight: bold; color: red; font-size: 1rem; margin-right: 0.5em; }.details { margin-top: 0.5rem; }.suggestion { margin-top: 1rem; }.details h3, .suggestion h3 { font-size: 1rem; color: #303133; margin-top: 0; margin-bottom: 0.25rem; font-weight: 600; }.details-content, .suggestion-content { font-size: 0.875rem; color: #606266; line-height: 1.7; }.details-content { min-height: 50px; }</style>
</head>
<body><div class="display-box"><div class="display-box-content"><div class="title"><span class="label">标题:</span><span>关于系统功能更新的详细说明</span></div><div class="details"><h3>详情</h3><div class="details-content"><p>此版本在左下角新增了一个椭圆形的渐变光晕效果,作为视觉点缀。</p></div></div><div class="suggestion"><h3>建议</h3><div class="suggestion-content"><p>这个效果是通过 ::after 伪元素结合椭圆形径向渐变和 overflow: hidden 实现的,光晕中点已向右移动。</p></div></div></div></body>
</html>
http://www.dtcms.com/a/414079.html

相关文章:

  • 针织厂家东莞网站建设河北教育网站建设
  • MySQL InnoDB压缩:OLTP性能优化实战
  • 【软件架构设计(40)】数据库规范化与性能优化
  • 鸿蒙NEXT蓝牙服务开发概述:构建无缝连接的物联网体验
  • 5G-A无源物联网:深度解析“不插电“智能的底层技术原理
  • Oracle与Kingbase深度兼容体验:从连接配置到性能优化全解析
  • github push 端口不通解决方案
  • OpenLayers地图交互 -- 章节十四:拖拽缩放交互详解
  • C++中 optional variant any 的使用
  • unity3d PuppetMaster 布娃娃插件在学习
  • 复古胶片风格室内人像自拍摄影后期Lr调色教程,手机滤镜PS+Lightroom预设下载!
  • 网站开发之前前后端不分离wordpress 缓存首页
  • 【仿生机器人】基于 GPT-SoVITS 的 发声器
  • 二分查找思路详解,包含二分算法的变种,针对不同题的做法
  • 58同城枣庄网站建设wordpress 会员分值
  • C# .NetCore WebApi 性能改进 响应压缩
  • PyTorch CNN 改进:全局平均池化与 CIFAR10 测试分析
  • 精读C++20设计模式——创造型设计模式:单例模式
  • 网络实践——基于epoll_ET工作、Reactor设计模式的HTTP服务
  • 设计模式-行为型设计模式(针对对象之间的交互)
  • 选手机网站彩票网站开发制作模版
  • qq钓鱼网站在线生成器北京网站设计公司地址
  • SQL流程控制函数完全指南
  • 做电商网站前端的技术选型是移动商城积分和积分区别
  • 弄一个关于作文的网站怎么做微信分销网站建设官网
  • 怎么做站旅游网站上泡到妞平面设计师服务平台
  • 温室大棚建设 网站及排名转卖类似淘宝网站建设有哪些模板
  • 广西网站建设-好发信息网阿里邮箱 wordpress
  • 便捷网站建设费用搜关键词网站
  • 网站添加百度地图导航wordpress安装 centos