Twitter Bootstrap Button Text Word Wrap

后端 未结 4 593
广开言路
广开言路 2020-12-07 09:51

For the life of me I am unable to get these twitter bootstrap buttons to text wrap onto multiple lines, they appearing like so.

I cannot post images, so this is what

相关标签:
4条回答
  • 2020-12-07 09:54

    You can add these style's and it works just as expected.

    .btn {
        white-space:normal !important; 
        word-wrap: break-word; 
        word-break: normal;
    }
    
    0 讨论(0)
  • 2020-12-07 10:08

    Try this: add white-space: normal; to the style definition of the Bootstrap Button or you can replace the code you displayed with the one below

    <div class="col-lg-3"> <!-- FIRST COL -->
      <div class="panel panel-default">
        <div class="panel-body"> 
        <h4>Posted on</h4>
        <p>22nd September 2013</p>
        <h4>Tags</h4>
        <a href="#" class="btn btn-primary btn-xs col-lg-12" style="margin-bottom:4px;white-space: normal;">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</a>
       <a href="#" class="btn btn-primary btn-xs col-lg-12" style="margin-bottom:4px;white-space: normal;">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</a>
       <a href="#" class="btn btn-primary btn-xs col-lg-12" style="margin-bottom:4px;white-space: normal;">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</a>
               </div>
      </div>
    </div>
    

    I have updated your fiddle here to show how it comes out.

    0 讨论(0)
  • 2020-12-07 10:08

    FWIW, in Boostrap 4.4, you can add .text-wrap style to things like buttons:

       <a href="#" class="btn btn-primary text-wrap">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</a>
    

    https://getbootstrap.com/docs/4.4/utilities/text/#text-wrapping-and-overflow

    0 讨论(0)
  • 2020-12-07 10:14

    You can simply add this class.

    .btn {
        white-space:normal !important;
        word-wrap: break-word; 
    }
    
    0 讨论(0)
提交回复
热议问题