开发者

Way to force text to wrap in browser even when it is a consecutive string with no spaces?

开发者 https://www.devze.com 2023-01-13 16:55 出处:网络
If I have a string like \"11111111101111111110111111111011111111101111111110111111111011111111101111111110111111111011111111101111111110111111111011111111101111111110111111111011111111101111111110开发

If I have a string like "11111111101111111110111111111011111111101111111110111111111011111111101111111110111111111011111111101111111110111111111011111111101111111110111111111011111111101111111110开发者_开发问答111111111011111111101111111110111111111011111111101111111110111111111011111111101111111110111111111011111111101111111110111111111011111111101111111110111111111011111111101111111110111111111011111111101111111110111111111011111111101111111110111111111011111111101111111110111111111011111111101111111110111111111011111111101111111110111111111011111111101111111110111111111011111111101111111110111111111011111111101111111110111111111011111111101111111110"

How can I get this string in my page to wrap? Here (stackoverflow) they do it.

Currently on my page it just displays on one line and flows way to the right ?


With a word-wrap:break-word:

<pre style="word-wrap: break-word;">LOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOONG</pre>

Or:

<style type="text/css">
.wrapit{
 word-wrap: break-word;
}
</style>
<div class="wrapit">LOOOOOOOOOOOOOOOONG</div>
0

精彩评论

暂无评论...
验证码 换一张
取 消