Zero-width non-breaking space

问题:

网页上面“5%”被分成了两行,“10%”在一行内,需要把5%也保持在一行内。


Update:

 在OS X的chrome中不起作用,需要换成‍或者‍


解决方法:

http://stackoverflow.com/a/11393767/2177408


There is no entity reference for ZWNBSP (zero-width no-break space) in HTML, but it, like any Unicode character, can be expressed using a character reference:  (or, equivalently, ). However, it is ineffective for keeping images in the same line. Images are not characters, and browsers are not required to implement Unicode semantics for ZWNBSP even when used between characters. The same applies to WORD JOINER, U+2060.

The most effective way is to wrap the img tags in a nobr element<nobr><img ...><img ...></nobr>. While not part of any HTML specification, and mentioned in HTML5 drafts as “obsolete”, this method works across browsers. If you would rather do things in a clumsier way that does not work when CSS is disabled, you can use an artificial wrapper element and set white-space: nowrap on it.

But there is: &zwj;since at least 2001 –  jthill  Jun 4 '14 at 18:20
@jthill, &zwj; denotes ZERO WIDTH JOINER U+200D, a different character, intended for requesting for cursive joining or ligature rendering. – Jukka K. Korpela Jun 4 '14 at 19:29

Ah. Thank you for the correction. I'll go read up on &zwnj; too. –  jthill  Jun 4 '14 at 19:37



 

Ah. Thank you for the correction. I'll go read up on &zwnj; too. –  jthill  Jun 4 '14 at 19:37

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值