6

Hover any button and you will see that it's moving by itself.
Why is this happening, is it a bootstrap bug?

HTML:

<div class="navbar-header" style="padding:4px 0 0 15px;">
  <button id="btnCadastrar" type="button" class="btn btn-default btn-sm" data-toggle="tooltip" data-placement="bottom" title="Cadastrar">
    <span class="glyphicon glyphicon-plus"></span>
  </button>
  <button id="btnEditar" type="button" class="btn btn-default btn-sm" data-toggle="tooltip" data-placement="bottom" title="Editar" style="margin-right:1px;">
    <span class="glyphicon glyphicon-edit"></span>
  </button>
  <button id="btnRemover" type="button" class="btn btn-default btn-danger btn-sm" data-toggle="tooltip" data-placement="bottom" title="Remover">
    <span class="glyphicon glyphicon-trash"></span>
  </button>
</div>

Bootply:
http://www.bootply.com/iYnzOb5GY4

BernardoLima
  • 1,103
  • 2
  • 16
  • 35
  • Possible duplicate of [Bootstrap tooltip causing buttons to jump](http://stackoverflow.com/questions/14364079/bootstrap-tooltip-causing-buttons-to-jump) – Nathalia Xavier Aug 08 '16 at 18:12

1 Answers1

24

Tooltips in button groups and input groups require special setting

When using tooltips on elements within a .btn-group or an .input-group, you'll have to specify the option container: 'body' (documented below) to avoid unwanted side effects (such as the element growing wider and/or losing its rounded corners when the tooltip is triggered).

Bootstrap Explanation for Tooltips

Here what you need to change in your code

JS

$('[rel=tooltip]').tooltip({container: 'body'});

HTML

Add this attribute to your buttons

data-container="body"

Here is Bootply link

Example

cvrebert
  • 9,075
  • 2
  • 38
  • 49
Ramiz Wachtler
  • 5,623
  • 2
  • 28
  • 33