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

【日常记录】【CSS】display:inline 的样式截断

文章目录

    • 1. 案例
    • 2. css属性:box-decoration-break
    • 参考地址

1. 案例

现在有一篇文章,某些句子,是要被标记的,加一些css 让他突出一下

可以看到,在最后,断开了,那如若要让 断开哪里的样式 和 开始 和结束 保持一致,如何处理呢、

在这里插入图片描述

<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Document</title><style>* {margin: 0;padding: 0;box-sizing: border-box;}div {width: 50vw;margin: auto;}span {background-color: aquamarine;border: 2px solid red;/* box-decoration-break: clone;-webkit-box-decoration-break: clone; */}</style>
</head><body><div>Nestled in the heart of Beijing lies a masterpiece of Chinese architecture and history — the Forbidden City. Thisimperial palace complex, also known as the Palace Museum, spans over 180 acres and captivates visitors with itsgrandeurand historical significance.As one steps through the imposing Meridian Gate, a world of ancient splendor unfolds. The vast courtyards, intricatepavilions, and ornate halls are a testament to the craftsmanship and cultural richness of imperial China. Eachbuildingis adorned with traditional Chinese motifs, from dragon carvings to vibrant ceramic tiles, reflecting the meticulousattention to detail of the Ming and Qing dynasties.<span>The Forbidden City is not only a marvel of architecture but also a sanctuary of natural beauty. Lush gardens,meticulously landscaped over centuries, provide serene retreats amidst the bustling city. The Imperial Garden,withits</span>ancient cypresses and winding pathways, evokes a sense of tranquility and harmony.Beyond its architectural and natural beauty, the Forbidden City holds a rich tapestry of history and culturalheritage.For over 500 years, it served as the political and ceremonial center of the Chinese empire, witnessing the rise andfallof dynasties. Today, it stands as a UNESCO World Heritage Site and a symbol of China's enduring legacy.Visitors to the Forbidden City are transported back in time, exploring the opulent living quarters of emperors, theceremonial halls where imperial edicts were pronounced, and the sacred altars where rituals were performed. The HallofSupreme Harmony, with its golden throne and intricate ceiling decorations, embodies the pinnacle of imperial powerandarchitectural mastery.As the sun sets over the Forbidden City, the vermilion walls and golden roofs glow in the soft evening light,casting amagical aura over the ancient complex. The blend of history, artistry, and natural beauty makes the Forbidden Citynotjust a historical site but a living testament to China's rich cultural heritage.In conclusion, the Forbidden City in Beijing stands as a timeless marvel, where the beauty of architecture, nature,andhistory converge. It remains a must-visit destination for travelers seeking to immerse themselves in the grandeurandlegacy of ancient China.</div>
</body></html>

2. css属性:box-decoration-break

语法

box-decoration-break: slice;
box-decoration-break: clone;

属性值

  • slice:元素被按照盒子被切割前的原始样式渲染;默认值
  • clone:每个框片段与指定的边框、填充和边距独立呈现。

在这里插入图片描述
在这里插入图片描述

从这两幅图中就可以看出来区别了,clone 会是每个片段都是独立呈现

注意,在webket 内核的浏览器上,是要加一个前缀的,不然不生效

      box-decoration-break: clone;-webkit-box-decoration-break: clone;

参考地址

  • box-decoration-break MDN 文档

相关文章:

  • 北京网站建设多少钱?
  • 辽宁网页制作哪家好_网站建设
  • 高端品牌网站建设_汉中网站制作
  • Java基础笔记(面试题)
  • 抖音短视频seo矩阵系统源码(搭建技术开发分享)
  • 前端开发体系+html文件详解
  • live555关于RTSP协议交互流程
  • LabVIEW鼠标悬停在波形图上的曲线来自动显示相应点的坐标
  • 【ffmpeg命令基础】流复制
  • 弹性伸缩:如何在Eureka中实现服务的自动扩展和收缩
  • VTK----3D picking的原理、类型及实现
  • Apache Sqoop
  • Qt Events 汇总整理
  • 【C++】编程新思想,通过封装新的类创建新的数据类型
  • taro小程序terser-webpack-plugin插件不生效(vue2版本)
  • 同三维T80004解码器视频使用操作说明书:高清HDMI解码器,高清SDI解码器,4K超清HDMI解码器,双路4K超高清解码器
  • 【Android】传给后端的Url地址被转码问题处理
  • C#统一委托Func与Action
  • 【划重点】MySQL技术内幕:InnoDB存储引擎
  • ES2017异步函数现已正式可用
  • Java IO学习笔记一
  • JavaWeb(学习笔记二)
  • js操作时间(持续更新)
  • JS数组方法汇总
  • LeetCode算法系列_0891_子序列宽度之和
  • python_bomb----数据类型总结
  • react-native 安卓真机环境搭建
  • Vue.js源码(2):初探List Rendering
  • Vue--数据传输
  • 包装类对象
  • 看域名解析域名安全对SEO的影响
  • 用mpvue开发微信小程序
  • 在Mac OS X上安装 Ruby运行环境
  • 怎么把视频里的音乐提取出来
  • 3月27日云栖精选夜读 | 从 “城市大脑”实践,瞭望未来城市源起 ...
  • AI又要和人类“对打”,Deepmind宣布《星战Ⅱ》即将开始 ...
  • Java数据解析之JSON
  • PostgreSQL之连接数修改
  • 第二十章:异步和文件I/O.(二十三)
  • 容器镜像
  • #git 撤消对文件的更改
  • (14)目标检测_SSD训练代码基于pytorch搭建代码
  • (175)FPGA门控时钟技术
  • (70min)字节暑假实习二面(已挂)
  • (二)c52学习之旅-简单了解单片机
  • (附源码)ssm码农论坛 毕业设计 231126
  • (十五)devops持续集成开发——jenkins流水线构建策略配置及触发器的使用
  • (源码版)2024美国大学生数学建模E题财产保险的可持续模型详解思路+具体代码季节性时序预测SARIMA天气预测建模
  • (转)可以带来幸福的一本书
  • (转)母版页和相对路径
  • .NET Core 控制台程序读 appsettings.json 、注依赖、配日志、设 IOptions
  • .NET IoC 容器(三)Autofac
  • .NET/C# 使窗口永不获得焦点
  • .NET6 命令行启动及发布单个Exe文件
  • .NET框架
  • @Autowired @Resource @Qualifier的区别
  • @for /l %i in (1,1,10) do md %i 批处理自动建立目录
  • [ 物联网 ]拟合模型解决传感器数据获取中数据与实际值的误差的补偿方法