gpt4 book ai didi

jquery - 在 Chrome 中查看时选择框中的白色背景

转载 作者:可可西里 更新时间:2023-11-01 14:57:53 24 4
gpt4 key购买 nike

此 html 仅在 chrome 中使选定值不可见,在其他浏览器中选择的背景是彩色的,仅在 chrome 中是白色

<HTML>
<head>
<title>
title
</title>
<link id="siteThemeLink" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.8/themes/excite-bike/jquery-ui.css"
rel="stylesheet" type="text/css" />
</head>

<body>
<select class='ui-state-error'>
<option>hi</option>
<option>hi</option>
<option>hi</option>
</select>
</body>
</HTML>

有人知道解决方法吗?

最佳答案

Google Chrome 浏览器不支持选择的背景图片,这就是样式表中的规则失效的原因。

要修复它,您需要分别指定背景颜色和背景图像,以便不支持背景图像的浏览器不会忽略整个规则,但至少会选择它们支持的规则:

.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {
background-color: #E69700;
background-image: url(images/ui-bg_diagonals-thick_20_e69700_40x40.png) 50% 50% repeat;
}

或者,您可以只在样式属性中设置背景颜色,但这不如其他解决方案干净:

<select class='ui-state-error' style='background-color: #E69700;'>

关于jquery - 在 Chrome 中查看时选择框中的白色背景,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5270332/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com