Bootstrap Tooltips initialising but not showing

2019-08-06 18:25发布

I am trying to set up Bootstrap Tool Tips and it doesn't seem to be working.

<p>This is a <a href="#" title="A collection of words.">sentence</a> with a tooltip</p>​

and

$(document).ready(function(){
    $("a").tooltip();
});​

I have set up the following jsFiddle

The html appears to be transformed to the following:

<p>This is a <a href="#" data-original-title="A collection of words.">sentence</a> with a tooltip</p>

And the tooltip html is rendered:

<div class="tooltip fade top in" style="top: -34px; left: 20.5px; display: block; "><div class="tooltip-arrow"></div><div class="tooltip-inner">A collection of words.</div></div>

With the correct CSS styles:

enter image description here

But it is never shown in the browser?

enter image description here

1条回答
孤傲高冷的网名
2楼-- · 2019-08-06 19:23

It does work, it's just that in jsfiddle, everything outside the HTML box is hidden.

Updated version to show padding: http://jsfiddle.net/ytpAy/3/

Fred

查看更多
登录 后发表回答