【发布时间】:2014-02-21 08:28:01
【问题描述】:
我正在尝试设置 jQueryUI 自动完成的样式,但终生无法找到如何在悬停时覆盖下拉列表中的样式!
(我追求的是干净的平面外观,没有图像或渐变)。
我创建了一个说明问题的 plunkr:http://plnkr.co/edit/pUdcIRgWDcnfuKYVpyQV?p=preview
我在所有其他 jQUI 元素上都取得了成功,但不是这个。我也浏览了 CSS 文件,但我想知道 JS 是否正在添加某些内容,而我在 Chrome 中无法观察到它?
即使在 Chrome 中检查也很麻烦(我建议右键单击暴露的 <li>)
欢迎提出建议,谢谢
jquery.ui.theme.min69d2.css 中的 jQueryUI 样式
.ui-state-hover,
.ui-widget-content .ui-state-hover,
.ui-widget-header .ui-state-hover,
.ui-state-focus,
.ui-widget-content .ui-state-focus,
.ui-widget-header .ui-state-focus {
/* this is the damned hover!! */
border:1px solid #999;
background:#dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x;
font-weight:normal;
color:#212121;
/* an override in place: this works */
border: none;
background-image: none;
background: yellow;
color:blue;
}
我的样式表,它出现在 jqueryUI 之后并且更具体(在 #id 下)
.ui-state-hover,
.ui-widget-content .ui-state-hover,
.ui-widget-header .ui-state-hover,
.ui-state-focus,
.ui-widget-content .ui-state-focus,
.ui-widget-header .ui-state-focus {
/* fails */
border: none !important;
background-image: none !important;
background: yellow !important;
color:blue !important;
}
【问题讨论】: