【问题标题】:I want to show opacity:1 for input[type="number"] placeholders我想为 input[type="number"] 占位符显示 opacity:1
【发布时间】:2015-08-09 03:18:45
【问题描述】:

我有一个带有input[type="number"] 的表单。

占位符在浏览器上显示降低的不透明度。 我想为输入占位符显示opacity:1input[type="text"] 显示正确,但 input[type="number"] 显示不正确。

不明白为什么会这样。

CSS

input::-moz-placeholder{
  opacity: 1
}

textarea::-moz-placeholder{
  opacity: 1
}

谁能帮帮我?

【问题讨论】:

标签: html css gecko


【解决方案1】:

尝试将 css 标记为重要,以便呈现

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

【讨论】:

    【解决方案2】:

    这是 Firefox 中的一个错误。这在 Firefox 中似乎不起作用。

    检查Firefox bugFirefox bug

    【讨论】:

    • 抱歉回复晚了,但这是 Firefox 中的一个错误,所以还有其他实验吗?
    【解决方案3】:

    在扩展支持下试试这个

    input[type="number"]::moz-placeholder { 
      opacity:1 !important;
    }
    input[type="number"]:moz-placeholder { 
      opacity:1 !important;
    }
    input[type="number"]::-webkit-input-placeholder { 
      opacity:1 !important;
    }
    
    input[type="number"]:-ms-input-placeholder { 
      opacity:1 !important;
    }
    

    【讨论】:

      猜你喜欢
      • 2019-06-04
      • 2014-06-24
      • 2015-04-20
      • 2011-10-04
      • 2019-11-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-09-19
      相关资源
      最近更新 更多