Color for styled placeholder text is muted in Firefox

☆樱花仙子☆ 提交于 2019-12-02 09:53:09

问题


I've changed the color of my placeholders with the relevant vendor prefixes and it's displaying properly in other browsers, but for some reason Firefox mutes the colors a bit.

::-moz-placeholder, input::-moz-placeholder {color: Black;} 

I've used both :-moz-placeholder and ::-moz-placeholder prefixes. Any suggestions?


回答1:


The default placeholder style has an opacity different from 1, so that if you change the input color the placeholder automatically ends up with a slightly muted version of that color.

Try setting opacity: 1 in addition to the color.




回答2:


I think you are expecting this, just try this once,

input[type="text"]:hover::-moz-placeholder {
    color: #000000;
}

above is for text inputs if you need for all inputs remove [type='text']. Okay



来源:https://stackoverflow.com/questions/24236240/color-for-styled-placeholder-text-is-muted-in-firefox

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!