当使用“所有一个单词”时,有没有任何方式来包装html文本? [英] Is there any way to wrap html text when 'all one word' is used?

查看:84
本文介绍了当使用“所有一个单词”时,有没有任何方式来包装html文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能重复:

我有这个css和html问题。我有一个描述,我想把它放在一个100px宽的框,我想让文本向下流动的页面。我已经设置了像这样的div:

I have this css and html issue. I have a description and I want to fit it in a box that is 100px wide and I want the text to flow down the page. I have set up a div like thisL:

<div style="width:100px; border:1px Solid Black; height:200px; overflow:scroll; "><p>text here...</p></div>

但是当我把文本放进去,没有空格时,文本不会换行。因此,如果用户要放入一个字宽度超过100px宽,那么文本将流向右边,我不想.... ....

However when I put text in and there is no white space the text does not wrap. So if a user was to put in one word that spanned more than 100px wide then the text will flow off to the right which I dont want....

任何方式停止这个?我注意到facebook墙帖子不做这个行为....

Any way to stop this? I noticed facebook wall posts dont do this behaviour....

推荐答案

最直接的方法是使用 word-wrap:break-word

查看操作

这篇关于当使用“所有一个单词”时,有没有任何方式来包装html文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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