nbsp 的反义词是什么?
字符是不允许换行的空格。
<p>lorem ipsum here are some words and so on</p>
| lorem ipsum |
| here are some words and so |
| on |
与此相反的是什么呢?也就是说,一个字符不呈现为空格,但可以用于换行。
<p>foo supercalifragilisticexpialidocious bar</p>
<!-- put char here ^ and here ^ -->
|foo supercalifragi |
|listicexpiali |
|docious bar |
or with wider size:
|foo supercalifragilisticexpiali |
|docious bar |
我知道软连字符,但出于我的目的,我特别不希望在分隔符处添加连字符。
A
character is a space which doesn't allow for line breaking.
<p>lorem ipsum here are some words and so on</p>
| lorem ipsum |
| here are some words and so |
| on |
What's the opposite of that? That is, a character which is NOT rendered as a space, but CAN be used for line breaking.
<p>foo supercalifragilisticexpialidocious bar</p>
<!-- put char here ^ and here ^ -->
|foo supercalifragi |
|listicexpiali |
|docious bar |
or with wider size:
|foo supercalifragilisticexpiali |
|docious bar |
I'm aware of the soft-hyphen character, but for my purposes, I specifically do not want a hyphen added at the break.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
您需要 unicode 字符零宽度空格 (\u200B)。
您可以使用
或
获取 HTML 格式的内容。You want the unicode character ZERO-WIDTH SPACE (\u200B).
You can get it in HTML with
or
.还有一个鲜为人知的 wbr 标签,它让浏览器决定是否中断行与否。
There also is the little-known wbr tag, which lets the browser to decide whether to break the line or not.
quirksmode.org 上有一个很好的页面,恕我直言,它很好地回答了这个问题。 http://www.quirksmode.org/oddsandends/wbr.html
简而言之:使用>或 (或 但你提到你不想要破折号)。
There's a nice page over at quirksmode.org that answers this question quite nicely IMHO. http://www.quirksmode.org/oddsandends/wbr.html
In short: use <wbr /> or (or but you mentioned you don't want the dash).
使用 。
use <wbr>.
您可以使用名为 word-wrap 的 CSS3 属性
希望有帮助!
You can use CSS3 property called word-wrap
Hope it helps!
关于这一点有很多讨论,但使用
或多或少已经成为标准theres a lot of discussion about this but it has become more or less standard to use