【发布时间】:2015-08-28 04:50:16
【问题描述】:
当用户将鼠标悬停在链接/复选框/数据上时,我使用bootstrap popover 显示数据。
如何在我的 html 中将单独的 css 类添加到不同的弹出框,以确保正确显示特定的弹出框。
我想添加到下面的 html 代码中的 css 类也显示在下面,名为 popover_margin_left。
这是我的html代码:
<span style="cursor: pointer;"
rel="popover"
data-content="{% trans 'The Test Details that should be included in your document is the data and information that you want displayed to all team members.' %} {% trans 'The Test Details that should be included in your document is the data and information that you want displayed to all team members.' %} {% trans 'The Test Details that should be included in your document is the data and information that you want displayed to all team members.' %}"
data-original-title="{% trans 'Test Details' %}"
data-placement="right">
<input type="checkbox" name="TestDetails" checked="checked" readonly="true" disabled="false" class="checkbox_resize" >
{% trans "Test Details" %}</span>
</input>
</span>
这是我的 CSS:
/* change default bootstrap popover width & z-index */
.popover {
direction: rtl;
min-width: 375px;
position: fixed;
word-break: normal;
word-wrap: break-word;
z-index: 9999; /* maintain a high z-index to bring the popover in the breadcrumbs forward */
background-color: khaki;
}
.popover_margin_left {
margin-left: -12px;
}
【问题讨论】:
-
我认为您可以将
class:popover_margin_right添加到您的html。将其添加到您要添加的标签中。 -
我试过了。除非你的意思不同——也许你可以给我举个例子。
-
你在你的css中使用
!important像.popover_margin_left { margin-left : -12px!important; } -
总是尽量避免使用
!important!! @user1261774 如果可以的话,创建一个 JSFiddle 会更有帮助 -
amit singh - 但是如何将 css 类应用于弹出框??
标签: html css twitter-bootstrap-3 popover