在div内包装没有空格的长文本 [英] Wrapping long text without white space inside of a div

查看:76
本文介绍了在div内包装没有空格的长文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在换行时遇到问题.我正在生成一些hexencoding加密,并且输出太长,如:

I am having issues with wrapping text. I am generating some hexencoding encryption and the output is too long like:

827938828ey823876te37257e5t328er6367r5erd663275e65r532r6s3624e5645376er563rdr753624e544341763r567r4e56r326r5632r65sr32dr32udr56r634r57r57rd63725

827938828ey823876te37257e5t328er6367r5erd663275e65r532r6s3624e5645376er563rdr753624e544341763r567r4e56r326r5632r65sr32dr32udr56r634r57rd63725

,然后继续.当我将它放在div内时,即使我指定了特定的宽度,它也不会包装它,因为它们都在一起.如果div的宽度不足一行,我希望它从下一行继续.

and it continues. When I put it inside a div, it won't wrap it even if I assign a specific width, because they are all together. I want it to continue from the next line if the div is not wide enough for one line.

我该怎么做?

推荐答案

您不能包装该文本,因为文本没有任何空格也不会破裂.您需要一个JavaScript或服务器端解决方案,该解决方案将字符串分割成几个字符.

编辑

您需要在CSS中添加此属性.

You need to add this property in CSS.

word-wrap: break-word;

这篇关于在div内包装没有空格的长文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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