How do you change the width and height of Twitter Bootstrap's tooltips?

后端 未结 21 1499
情歌与酒
情歌与酒 2020-12-12 13:26

I created a tooltip using Twitter Bootstrap.

The tooltip is displaying with three lines. However, I would like to display the tooltip with only one line.

How

21条回答
  •  渐次进展
    2020-12-12 14:03

    Setting the max-width of class tooltip-inner didn´t work for me, I´m using bootstrap 3.2

    Some how setting max-width only work if you set the width of parent class (.tooltip).

    But then all tooltips become the size you specify. So here´s my solution:

    add a Width to the parent class:

    .tooltip {
      width:400px;
    }
    

    Then you add the max-width and change the display to inline-block, so it will not occupy the entire space

    .tooltip-inner {
      max-width: @tooltip-max-width;
      display:inline-block;
    }
    

提交回复
热议问题