2

$(function () {
  $('[data-toggle="tooltip"]').tooltip()
})
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<script defer src="https://use.fontawesome.com/releases/v5.0.6/js/all.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<span class='fas fa-print' data-toggle='tooltip' data-placement='bottom' title='Print'>Printing</span>

在这段代码中,span有一个tooltip切换,当我将鼠标悬停在它上面时,

它显示我Bootstrap Tooltip然后Standard Tooltip直接显示它之后,b

看到他们两个,到底是什么问题?

4

1 回答 1

5

我认为字体很棒的 svg 把它搞砸了。将图标包装在工具提示的单独跨度中...

<span data-toggle="tooltip" data-placement="bottom" title="Print">
   <span class="fas fa-print">Printing</span>
</span> 
于 2018-02-22T20:29:51.723 回答