启动程序会拉取之前输入的内容并动态生成以下 HTML:
.dropdown-menu .active > a,
.dropdown-menu .active > a:hover {
color: #333333;
text-decoration: none;
background-color: #0081c2;
...
}
为此,要在不修改下拉列表的情况下重新绘制预输入,您需要在此之后的某个位置添加一条规则。 加载 bootstrap.css 后,我将其放入单独的文件中。 *
.typeahead .active > a,
.typeahead .active > a:hover {
color: white;
/* Change the typeahead background color here if you'd like */
background-color: Green;
/* Turns off the default background gradients */
background-image: none;
}
*最佳实践建议您在投入生产时结合缩小所有 CSScss默认d,但无论如何,此规则应该串联css默认d,除非您使其比 .dropdown-menu 规则更具体。