CSS Bootstrap Popover 需要设置 data-original-title 的样式
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/22080574/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Bootstrap Popover need to style data-original-title
提问by DivineChef
Created a popover in bootstrap that has a title (data-original-title). How can I make it bold?
在引导程序中创建了一个具有标题(数据原始标题)的弹出窗口。我怎样才能让它大胆?
<td class="setWidth concat"><div class="boldTitle"><a href="#" class="tip" rel="popover" data-trigger="hover" data-content="Hypercholesterolemia is a condition characterized by very high levels of cholesterol in the blood. Cholesterol is a waxy, fat-like substance that is produced in the body and obtained from foods that come from animals (particularly egg yolks, meat, poultry, fish, and dairy products). The body needs this substance to build cell membranes, make certain hormones, and produce compounds that aid in fat digestion. Too much cholesterol, however, increases a person's risk of developing heart disease."
data-original-title="Hypercholesterolemia">
<span style="cursor:pointer;">Hypercholesterolemia</span></a></div></td>
Fiddle Link http://jsfiddle.net/DivineChef/8J5w6/1/
回答by Alp
Here are three possibilities to achieve your goal.
以下是实现目标的三种可能性。
Use
data-html=true
and wrap your title in a<strong>
element<a href="#" class="tip" rel="popover" data-trigger="hover" data-content="Hypercholesterolemia..." data-original-title="<strong>Hypercholesterolemia</strong>" data-html="true">Hypercholesterolemia</a>
Use
html: true
when initializing and wrap your title in a<strong>
element$('[rel=popover]').popover({ html : true });
Change the appearance of ALLpopover titles with CSS
.popover .popover-title { font-weight: bold; }
data-html=true
在<strong>
元素中使用和包装您的标题<a href="#" class="tip" rel="popover" data-trigger="hover" data-content="Hypercholesterolemia..." data-original-title="<strong>Hypercholesterolemia</strong>" data-html="true">Hypercholesterolemia</a>
使用
html: true
初始化时,敷你的标题在<strong>
元素$('[rel=popover]').popover({ html : true });
使用 CSS更改所有弹出窗口标题的外观
.popover .popover-title { font-weight: bold; }