问题描述
我试图在小屏幕(手机)上显示各种文本
文本是对齐的,但它发生,有一行有长的单词/公式/字符串,不适合
I'm trying to display various texts on small screens (phones)
text is justified but it happens that there is a line with long word /formula / string, that won't fit
有可能的 word-break:break-all; 中间的解决方案如下所示:
There is the possible word-break: break-all;, but it breaks lines too arbitrary, I would need a in-between solution like shows the following:
推荐答案
插入< wbr& code>标签指定允许的直接断行机会。
Insert the <wbr>
tag to specify an allowed direct line breaking opportunity.
理论上更正确的方法是插入零宽度空格字符U + 200B code>&#x200b; ),但在一些旧浏览器上失败。
The theoretically more correct method is to insert the zero-width space character, U+200B (​
), but it fails badly on some old browsers.
HTML中的断点:$ b $ b
A treatise on preventing and allowing line breaks in HTML:http://www.cs.tut.fi/~jkorpela/html/nobr.html
这篇关于打破逗号,点,连字符或其他特殊字符的长空格线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!