我想在Bootstrap选项卡里添加一个关闭图标,这样当我点击该图标时就可以关闭选项卡。
我尝试了下面的代码,但是“X”并没有显示在与选项卡标题同一行。
.close {
font-size: 20px;
font-weight: bold;
line-height: 18px;
color: #000000;
text-shadow: 0 1px 0 #ffffff;
opacity: 0.2;
filter: alpha(opacity=20);
text-decoration: none;
display:inline;
}
.close:hover {
display:inline;
color: #000000;
text-decoration: none;
opacity: 0.4;
filter: alpha(opacity=40);
cursor: pointer;
}
<a id="user-list-tab-li" style="display:inline;" href="#user-list-tab-pane">The tab</a>
<span class="close">×</span>
if ($(tabContentId).is(":visible"))
- Jesse Sierks