gpt4 book ai didi

html - Safari 浏览器的背景色保持白色

转载 作者:行者123 更新时间:2023-11-28 16:01:16 24 4
gpt4 key购买 nike

我必须为只读输入字段提供背景颜色 (#eeeeee)。

.form-control[disabled], 
.form-control[readonly],
fieldset[disabled] .form-control {
cursor: not-allowed;
background-color: #eeeeee;
opacity: 1;
}
<input id="tagNumber" name="j_username" class="form-control" tabindex="1" data-enhance="false" data-role="none" value="" maxlength="241" autocomplete="off" readonly="" type="text">

这在除 safari 浏览器之外的所有浏览器中都可以正常工作。在 safari 中,背景颜色保持为白色。我尝试通过 jquery 提供背景颜色,并在运行时向元素添加特定类。似乎没有任何效果。请帮忙。

它在非 Safari 浏览器上的外观:

enter image description here

它在 safari 浏览器上的外观:

enter image description here

最佳答案

试试这个可能有用

# @media screen and (-webkit-min-device-pixel-ratio:0)
{
#safari { background-color:#eeeeee }
}

或者在您的背景颜色中尝试 rgb,例如:

rgb(238, 238, 238) #eeeeee

background-color:rgb(238, 238, 238);

关于html - Safari 浏览器的背景色保持白色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40084508/

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