How to get a responsive button in bootstrap 3

后端 未结 5 794
逝去的感伤
逝去的感伤 2020-12-13 02:05

I am using bootstrap 3 and I have the following html:


      
5条回答
  •  春和景丽
    2020-12-13 02:54

    I know this already has a marked answer, but I feel I have an improvement to it.

    The marked answer is a bit misleading. He set a width to the button, which is not necessary, and set widths are not "responsive". To his defense, he mentions in a comment below it, that the width is not necessary and just an example.

    One thing not mentioned here, is that the words may break in the middle of a word and look messed up.

    My solution, forces the break to happen between words, a nice word wrap.

    .btn-responsive {
        white-space: normal !important;
        word-wrap: break-word;
    }
    
    Click Here
    

提交回复
热议问题