What's the opposite of a nbsp?

房东的猫 提交于 2019-11-27 17:16:35
Anon.

You want the unicode character ZERO-WIDTH SPACE (\u200B).

You can get it in HTML with ​ or ​.

Explicit breaks and non-breaks:

LB7 : Do not break before spaces or zero width space.
LB8 : Break before any character following a zero-width space, even if one or more spaces intervene.
http://unicode.org/reports/tr14/

Matt Hampel

There also is the little-known wbr tag, which lets the browser to decide whether to break the line or not.

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 &#8203; (or &shy; but you mentioned you don't want the dash).

use <wbr>.

Swanidhi

You can use CSS3 property called word-wrap

p.test {word-wrap:break-word;}

Hope it helps!

theres a lot of discussion about this but it has become more or less standard to use &shy;

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!