html - CSS:为什么 Chrome 和 Firefox 中的颜色代码 #999 色调不同?

标签 html css google-chrome firefox

<分区>

我需要如下更改 HTML5 输入占位符样式。

input[type="text"]#myInput::placeholder {
font-size: 13px;
  font-family: helvetica;
  color: #999;
  font-weight: 400;
}

在上面的代码片段中,我使用了#999 色度,但它在 chrome 和 IE 中看起来很不错,在 Firefox 中看起来很浅。

我的示例代码在这里:https://codepen.io/JGSpark/pen/MMQxER?&editable=true

请先在 Chrome 中尝试此操作,然后再在 Firefox 中尝试。

P.S: 我使用的是 Chrome 75+, Firefox 67+, IE11

任何人都可以帮助我使它在所有浏览器中看起来都相似吗?

最佳答案

Firefox 19 及更高版本默认对占位符文本应用 40% (0.4) 的不透明度。只需添加不透明度:1;

input:-moz-placeholder,
input::-moz-placeholder {
    opacity: 1 !important;
}

关于html - CSS:为什么 Chrome 和 Firefox 中的颜色代码 #999 色调不同?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56831090/

相关文章:

html - 是否可以将 td 居中放置在 table 中间

json - 如何运行react(使用webpack)作为chrome扩展

html - CSS - float 、固定和动态宽度

java - Spring MVC 绝对URL问题

html - 导航栏中的 Bootstrap 输入组

css - 如何在不使 CSS3 多列 div 变窄的情况下添加 float 图像?

html - 将 CSS 从 Web 移动到本地会破坏它

google-chrome - 如何通过命令行安装 crx Chrome 扩展?

javascript - 如何打开一个mailto : link from a Chrome Extension?

python - 使用 selenium python 网络驱动程序从 Angular 单击表格中的所有行