HTML中的自动分隔线

前端之家收集整理的这篇文章主要介绍了HTML中的自动分隔线前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我一直在做评论框,看到我的评论后我遇到了问题.我想要的只是当它超过容器时让我的评论自动断行,但我现在得到的是一条直线.

例如:

tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt

我希望我的文字可以是这样的:

ttttttttttttt
ttttttttttttt 
ttttttttttttt 
ttttttttttttt 

我应该使用什么来使我的文本自动断行?

解决方法

这听起来就像你在自动换行之后:break-word,以及它的跨浏览器变体.

见:https://developer.mozilla.org/en/CSS/white-space

selector {
      word-wrap: break-word;      /* IE 5.5-7 */
      white-space: -moz-pre-wrap; /* Firefox 1.0-2.0 */
      white-space: pre-wrap;      /* current browsers */
}

演示:http://jsfiddle.net/MCj6s/

原文链接:https://www.f2er.com/html/232286.html

猜你在找的HTML相关文章