6

I compiled this jsFiddle demo so that you can see what i am going throw. Using the Twitter Bootstrap 2 i thought everything was fine and simple things were taken care until i hit with this. I don't understand if the markup is not right or the library doesn't handle this but the text when long just overflows out of screen/container

JsFiddle

http://jsfiddle.net/kSCa3/2/

Community
  • 1
  • 1
Deeptechtons
  • 10,945
  • 27
  • 96
  • 178

4 Answers4

10

Try this:

div {
  word-break: break-all;
  word-wrap: break-word;
}​
orokusaki
  • 55,146
  • 59
  • 179
  • 257
Ketan Modi
  • 1,780
  • 1
  • 16
  • 28
9

Add word-wrap: break-word in your DIV. Write this:

.span9 {
    width: 700px;
    word-wrap: break-word;
}
sandeep
  • 91,313
  • 23
  • 137
  • 155
  • i knew the solution but to ask this is bug / unintended thing with the library is it? then how come when u see the demo page on their servers the documentation with large text are perfectly fine and showing well – Deeptechtons Feb 16 '12 at 09:23
  • 2
    It's not a bug of any library is a normally happening when an text is to long without any space. – sandeep Feb 16 '12 at 09:30
  • & i presume this is CSS3, clip is css2 counterpart ? or am i wrong – Deeptechtons Feb 16 '12 at 09:35
  • it's not a part of css3 & it's work till IE6 check this https://developer.mozilla.org/en/CSS/word-wrap – sandeep Feb 16 '12 at 09:39
5

I have just spent almost an entire day trying to solve this, and the above didn't work until I discovered this:

Make certain you also have fluid containers INSIDE the floated div:

<div class="container-fluid">

Otherwise it'll stay the same width and will spill over .. no matter what you do.

Ben Read
  • 51
  • 1
  • 1
0

maybe, you can try this too :

div.span9{
 white-space: pre-wrap;       /* css-3 */
 white-space: -moz-pre-wrap;  /* Mozilla, since 1999 */
 white-space: -pre-wrap;      /* Opera 4-6 */
 white-space: -o-pre-wrap;    /* Opera 7 */
 word-wrap: break-word;       /* Internet Explorer 5.5+ */

}
prestarocket
  • 733
  • 3
  • 12
  • 30