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
The :hover selector is used to show the tooltip text when the user moves the mouse over the <div> with class="tooltip" .
By default, tooltips will not be displayed on disabled elements. However, you can enable this behavior by using the following steps: Add a disabled element like the button element into a div whose display style is set to inline-block . Set the pointer event as none for the disabled element (button) through CSS.
Tooltip can be shown on Button hover and it can be achieved by setting title attribute.
The tooltip, also known as infotip or hint, is a common graphical user interface (GUI) element in which, when hovering over a screen element or component, a text box displays information about that element, such as a description of a button's function, what an abbreviation stands for, or the exact absolute time stamp ...
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 optioncontainer: '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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With