强制文本在浏览器中换行的方式,即使它是一个没有空格的连续字符串吗? [英] Way to force text to wrap in browser even when it is a consecutive string with no spaces?

查看:237
本文介绍了强制文本在浏览器中换行的方式,即使它是一个没有空格的连续字符串吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我有一个字符串

如何获取这个字符串在我的页面?这里(stackoverflow)他们做。

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 ?

推荐答案

使用换行:break-word

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

或:

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

这篇关于强制文本在浏览器中换行的方式,即使它是一个没有空格的连续字符串吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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