停用的输入元素样式 - Chrome和Firefox之间的差异 [英] Styling of disabled input elements - discrepancy between Chrome and Firefox
问题描述
我有一个禁用的输入元素,我使用下面的CSS样式:
input [disabled ='disabled'] {
color:#666;
}
此CSS在Firefox中正常工作,但Chrome会将文本颜色渲染为几种颜色太轻。如果我将颜色设置为黑色#000000
,Chrome会将其显示为深灰色而不是黑色。
在JSFiddle中的一个例子,它会显示差异: http://jsfiddle.net/2AtGX/
我如何获得
请检查此链接的答案:
简短答案:设置 -webkit-text-fill-color:black / p>
I have a disabled input element that I am styling using the following CSS:
input[disabled='disabled'] {
color: #666;
}
This CSS works as expected in Firefox, but Chrome renders the text color several shades too light. If I set the color all the way to black #000000
Chrome renders it as a dark grey instead of black. The problem here is that the CSS produces the expected result in Firefox, but not in Chrome.
An example in JSFiddle which will showcase the discrepancy: http://jsfiddle.net/2AtGX/
How can I get this disabled input element to look the same in Firefox and Chrome?
Please check this link for the answer:
How can I fully override Chromium disabled input field colours?
Short answer: set -webkit-text-fill-color: black
这篇关于停用的输入元素样式 - Chrome和Firefox之间的差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!