apincik
apincik

Reputation: 343

How to make text not to overflow box in bootstrap

i am using Bootstrap 3, and i have a text within a col and when it's longer, it does not fit the div and overflows it in the width of the box. I have used different display styles, do a lot of search but without success.

<div class="container-fluid">
    <div class="row">
        <div class="col-lg-10 col-md-10 col-sm-12 col-xs-12 col-lg-offset-1 col-md-offset-2">
          <div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
              <div class="thumbnail">
                <img src="http://www.kungfunguyen.com/wp-content/uploads/2013/08/Bootstrap-2-1-Is-the-Latest-Update-to-Twitter-s-Popular-Open-Source-Project.png">
                <div class="caption">
                  Very long text which oveflows the whole div in width.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                </div>
              </div>
            </div>
        </div>
    </div>
</div>

Example with thumbnail and caption, the same problem http://jsfiddle.net/zqeLse5q/

Thanks

Upvotes: 0

Views: 2957

Answers (1)

jonmrich
jonmrich

Reputation: 4323

.caption{
word-wrap: break-word;
}

http://jsfiddle.net/zqeLse5q/2/

Upvotes: 4

Related Questions