Changing font-family for placeholder

后端 未结 5 2144
你的背包
你的背包 2020-12-29 04:40

Is it posible for input field to have one font-family and it\'s placeholder other?

I have tried to change font-family for input\'s placeholder with already defined @

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-29 05:14

    Use this for major browser support :

    HTML:

    
    

    CSS:

    .mainLoginInput::placeholder { /* Chrome, Firefox, Opera, Safari 10.1+ */
      font-family: 'myFont', Arial, Helvetica, sans-serif;
      opacity: 1; /* Firefox */
    }
    
    .mainLoginInput:-ms-input-placeholder { /* Internet Explorer 10-11 */
      font-family: 'myFont', Arial, Helvetica, sans-serif;
    }
    
    .mainLoginInput::-ms-input-placeholder { /* Microsoft Edge */
      font-family: 'myFont', Arial, Helvetica, sans-serif;
    }
    

    Details reference link

提交回复
热议问题