在一行上保持一个文本字符串在一起 [英] Keeping a string of text together on one line

查看:123
本文介绍了在一行上保持一个文本字符串在一起的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一种方法可以保持一行文本字符串,所以如果div宽度变小,整个字符串将下降到下一行,而不是一半?

Is there a way to keep a string of text on one line, so that if the div width gets to small, the whole string will drop to the next line instead of half of it?

示例:

"Industry Updates - 8th
 September 2013" 

这通常发生在移动浏览器上,而对于更小的宽度,理想的情况是整个日期一起给予:

often this happens on mobile browers whereas with to smaller width, the ideal situation is that the whole date stays together giving:

"Industry Updates - 
 8th September 2013" 

那么是否有一个标签要使用或者css技巧来实现呢?
感谢

So is there a tag to use or a css trick to achieve this? Thanks

推荐答案

您希望在HTML标记中使用不间断的空格&

You want to use a non-breaking space in your HTML markup   instead of a normal space.

"Industry Updates - 8th September 2013" 

这篇关于在一行上保持一个文本字符串在一起的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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