“随处可见"是什么意思?意思是“自动换行"CSS属性? [英] What does "anywhere" mean in "word-wrap" css property?

查看:68
本文介绍了“随处可见"是什么意思?意思是“自动换行"CSS属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚在Firefox中发现了一个新的属性值,该属性值称为自动换行",即随处可见"(假设在Chrome中相同).它有什么作用?我记得使用普通(默认)或断词(对于大多数用途),但是随处可见"是什么意思?它与断词"有何不同?Mozilla.org尚未在其手册中列出该文件(还可以吗?)

任何地方"似乎都与断词"一样.我在Firefox 67.0中看到了这一点

 自动换行:任何地方; 

我真的不知道该怎么做.它有用吗?一直都在那儿,我只是错过了吗?

解决方案

请参阅

https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-wrap#Browser_compatibility

I just noticed in Firefox (I assume it's the same in Chrome) a new property value called "anywhere" of a property "word-wrap". What does it do? I remember using normal (which is default) or break-word (for most uses) but what does "anywhere" mean? How is it different from "break-word"? Mozilla.org doesn't have it listed in their manual (yet?)

"anywhere" seems to do the same thing "break-word" does. I'm seeing this in Firefox 67.0

word-wrap: anywhere;

I don't really know what to make of it. Is it usefull? Has it always been there all this time and I just missed it?

解决方案

Refer to the specification to find the definition:

anywhere

An otherwise unbreakable sequence of characters may be broken at an arbitrary point if there are no otherwise-acceptable break points in the line. Shaping characters are still shaped as if the word were not broken, and grapheme clusters must stay together as one unit. No hyphenation character is inserted at the break point. Soft wrap opportunities introduced by anywhere are considered when calculating min-content intrinsic sizes.

and later you can read:

break-word

As for anywhere except that soft wrap opportunities introduced by break-word are not considered when calculating min-content intrinsic sizes.


Simply notice that the browser support is quite limited:

https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-wrap#Browser_compatibility

这篇关于“随处可见"是什么意思?意思是“自动换行"CSS属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆