jquery - 如何在 bootstrap 工具提示 CSS/Jquery 中提到的文本中使单词变为粗体

标签 jquery css twitter-bootstrap

我试图在将鼠标悬停在图像上时显示 Bootstrap 工具提示。我在该工具提示中有一段文字需要将其设为粗体。

我从提到的来源尝试过这个,但对我没有用..

  <button class="infoTipsBox" type ="button" data-toggle="tooltip" data-placement="right"data-original-title='<b>big tooltip</b>'>      
  </button>

Js:

$(function () {
        $('[data-toggle="tooltip"]').tooltip();
    });

我做错了什么?? 在 title 属性的上述文本中,我试图将“bootstrap tooltip”设为粗体,其余部分设为普通字体。我怎样才能做到这一点?

最佳答案

正如您在 Bootstrap' official documnetation for tooltip 中看到的那样

Name    |    Type       |    default  |    Description
----------------------------------------------------------------------------
html    |    boolean    |    false    |    Insert html into the tooltip. 
                                           If false, jquery's text method 
                                           will be used to insert content 
                                           into the dom. Use text if you're 
                                           worried about XSS attacks.

因此,将 data-html="true" 添加到您的工具提示中,这将在您的工具提示中启用 HTML

关于jquery - 如何在 bootstrap 工具提示 CSS/Jquery 中提到的文本中使单词变为粗体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31041858/

相关文章:

css - Bootstrap CSS 导航栏属性

javascript - 类似幻灯片 Fullpage.js

javascript - 计算图像 A 比图像 B 大多少

css - Angular Material - 改变 md-radio-button 的颜色

css - W3 css 标准媒体查询的澄清 - "only"

twitter-bootstrap - 如何限制卡片组的列数?

search - 显示 twitter bootstrap typeahead 插件的自定义页脚

jquery - 使用 jQuery 查找选定控件或文本框的标签

javascript - bootstrap-datepicker 中的 getdates() 不起作用

css - 垂直居中多行 SVG 文本