突出显示Bootstrap中的列表项

时间:2013-11-28 02:12:07

标签: css twitter-bootstrap twitter-bootstrap-3

使用Drupal的Bootstrap模块我发现最新的版本更改了

的样式
.list-group-item.active, .list-group-item.active:hover, .list-group-item.active:focus

a.list-group-item.active, a.list-group-item.active:hover, a.list-group-item.active:focus

由于我的列表项不在a个标记内,active个标记已失去其高亮显示。风格本身非常简单,我可以自己重现它,但我更倾向于使用正式的Bootstrap方式来突出一个li。它是什么?

3 个答案:

答案 0 :(得分:8)

您必须创建自己的类(例如ERROR in [at-loader] ./node_modules/@angular/common/src/directives/ng_class.d.ts:48:34 TS2304: Cannot find name 'Set'. ERROR in [at-loader] ./node_modules/@angular/compiler/src/aot/compiler.d.ts:48:32 TS2304: Cannot find name 'Map'. )并将其应用于lineDecoded = [137,136,151,145,141,133,145,139,140,145,144,139,143,141,139,136,137,138,137,127,142,135,136,137,134,140,127,141,134,128,139,135,136,180,149,147,147,151,156,140,153,143,143,155,163,164,192,250,277,282,275,258,258,248,245,231,215,225,195,195,159,186,175,168,171,173,177,185,213,224,228,231,227,219,261,229,231,231,250,253,262,276,269,274,274,277,276,272,291,303,351,417,483,500,473,399,315,263,255,239,238,244,234,231,231,242,255,272,294,293,299,314,307,306,302,310,319,304,312,327,370,464,507,514,492,425,358,327,313,299,292,291,281,259,245,232,229,224,223,222,216,226,215,211,197,202,199,197,198,193,198,185,190,196,177,198,188,183,201,193,187,159,189,184,186,185,186,185,184,196,195,200,201,198,193,241,189,186,167,179,187,174,188,180,179,169,177,173,172,175,181,175,171,180,175,176,180,184,176,190,182,172,171,179,178,174,188,175,178,167,183,171,168,174,175,171,230,175,177,159,177,170,172,171,173,168,167,169,172,168,171,177,173,167,167,171,163,170,177,172,169,167,163,157,173,161,168,174,162,165,171,165,162,152,165,173,158,193,161,161,147,159,161,159,169,173,168,158,161,159,158,171,167,167,155,159,169,156,159,162,157,165,161,158,147,161,171,159] x = range(1,289) import matplotlib.pyplot as plt plt.plot(x, lineDecoded) 元素:

.list-group-hover

答案 1 :(得分:7)

对于不在锚标记内的li元素,没有“官方”引导样式。您必须在外部添加样式。

答案 2 :(得分:1)

正如OP所提到的,<li>元素的样式在Bootstrap 3.0.0中有效,但在最新的3.1.1版本中,它已从主bootstrap.css文件中删除。但是,我确实在bootstrap-theme.css文件中找到了它,所以也许他们认为它应该是主题的一部分而不是Bootstrap核心的一部分?

我还发现我从bootswatch.com下载的主题中缺少它,所以他们可能正在遵循bootstrap核心的示例,只允许<a>元素上的活动标记。