早在 2007 年就有人向 w3 组织提交了css 草案 white-space-collapse 。不过一直没有得到实现,而且各大浏览器貌似也不想实现。先看下 white-space-collapse 的作用吧
white-space-collapse 用于设置或者检索对象内包含的空格字符,属性有:
- collapse 使用一个单一的字符序列呈现空白(或在某些情况下,没有字符)。
- preserve 呈现所有的空白,换行符将被保留
- preserve-breaks 抛弃所有空白,但保留空白
- discard 抛弃所有空白
也就是说 如果采用了 white-space-collapse:discard;那么下面的代码
<span>字</span> <span>符中间有空白</span>
而现在由于没有实现white-space-collapse,我们可能要用很多方法来解决中间出现空白的问题,其中最简单也是最繁琐的方法是,手工去掉空白
<span>字</span><span>符中间没有空白</span>
这种方法很繁琐,但是没有副作用。
各大浏览器要实现这个的话,想想问题还真多,比如直接的空白符号和转义 这种2种写法应该是有不同处理的,很可能影响太大了。
相关推荐
npm install collapse-white-space 用 import { collapseWhiteSpace } from 'collapse-white-space' collapseWhiteSpace ( '\tfoo \n\tbar \t\r\nbaz' ) //=> ' foo bar baz' 原料药 该程序包导出以下标识符: ...
复制代码代码如下:”c1″>safjaskflasjfklsajfklasjflksajflksjflkasfdsafdsfksafj</div><div class=c1>This is all English. This is all English. This is all English.</div><div class=c1>全是中文的情况。...
非常好的CR论文,对研究CR的人有帮助,TV white-space sensing prototype
今天碰到了td文字内容不换行,发现是:white-space: nowrap,即强制文本不进行换行,顺便看了一下文本换行的属性word-wrap,总结如下: white-space的默认只是normal,自动换行。 word-break:break-all和word-wrap:...
5GAA_White-Paper-CV2X-Roadmap.pdf
Deep Learning for Signal Processing with MATLAB。Deep learning networks have been used for image classification for many years, but they are powerful tools for signal data as well....
使用MATLAB实现信号处理的深度学习,中文白皮书 本白皮书将回顾一些深度学习基础知识,然后会讲解三个信号处理示例: • 语音命令识别 • 剩余使用寿命 (RUL) 预估 • 信号去噪 这些示例将向您展示如何通过 MATLAB®...
前端开源库-pixel-white-bg像素白色背景,为像素设置白色背景色。
white-sdk-bridge 介绍 基于 dsbridge 将 封装成 native 可用,Android iOS 一致的 API。 iOS 端使用,Android 端使用 调用,保证API 一致性。 web-sdk 使用见 使用 本项目编译出的文件,会被整体打包进 white-sdk ...
White-box testing is a verification technique software engineers can use to examine if their code works as expected. In this chapter, we will explain the following: *a method for writing a set of ...
Metaverse-white-paper-v2.1-EN.pdf
Path-white-paper-chinese 中文版白皮书 Path-white-paper-chinese
主要介绍了使用white-space来阻止文字显示自动换行的方法,同时文中也介绍了超出规定长度部分隐藏等相关的一些技巧,需要的朋友可以参考下
css强制文字不换行,可给指定的容器增加white-space:nowrap即,下面把CSS示例写给大家,很简单
文献阅读报告White-Box Transformers via Sparse Rate Reduction.docx
In this White Paper, representatives from both the automotive and the telecom industry provide their vision on how 5G will enable the next generation of connected and automated driving and new ...
Metaverse-digital-identity-white-paper-v1.0-EN.pdf