Stop word-wrap dividing words(停止自动换行分割单词)
问题描述
body { word-wrap: break-word;}
我一直在使用该代码(上图)将 body 中的文本放入它的容器中.然而,我不喜欢它,它打破了文字.
I've been using that code (above) to fit the text in the body into it's container. However what I don't like about it, is that it breaks up words.
是否有另一种方法可以不分词,只在单词之后或之前换行?
Is there another way where it will not break up words and only line break after or before a word?
这是在 UIWebView 中使用的.
推荐答案
使用 white-space: nowrap;.如果您在设置它的元素上设置了宽度,它应该可以工作.
use white-space: nowrap;. If you have set width on the element on which you are setting this it should work.
更新 -在 Firefox 中呈现数据
update - rendered data in Firefox
这篇关于停止自动换行分割单词的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:停止自动换行分割单词
基础教程推荐
- npm start 错误与 create-react-app 2022-01-01
- Bokeh Div文本对齐 2022-01-01
- Bootstrap 模态出现在背景下 2022-01-01
- 如何添加到目前为止的天数? 2022-01-01
- 原生拖动事件后如何获取 mouseup 事件? 2022-01-01
- 在 contenteditable 中精确拖放 2022-01-01
- Fabric JS绘制具有活动形状的多边形 2022-01-01
- fetch 是否支持原生多文件上传? 2022-01-01
- 检查 HTML5 拖放文件类型 2022-01-01
- 即使用户允许,Gmail 也会隐藏外部电子邮件图片 2022-01-01
