Twitter Bootstrap - how to add some more margin between tooltip popup and element

后端 未结 4 2157
自闭症患者
自闭症患者 2021-02-19 09:23

i have not tryed anything since i can\'t understand where space between tooltip and element is made/added from bootstrap, normally tooltip is really near the element who trigge

4条回答
  •  广开言路
    2021-02-19 10:04

    This is the default CSS for a tooltip on top :

    .tooltip.top {
      padding: 5px 0;
      margin-top: -3px;
    }
    

    You can override it in your own CSS :

    .tooltip.top {
      margin-top: -10px;
    }
    

    Note this code will only work work a tooltip on top, you'll nedd to adapt the CSS for the 3 other orientations :

    .tooltip.top    { margin-top: -10px; }
    .tooltip.right  { margin-left: 10px; }
    .tooltip.bottom { margin-top: 10px;   }
    .tooltip.left   { margin-left: -10px; }
    

提交回复
热议问题