Placeholder font-size bigger than 16px

后端 未结 5 1310
不知归路
不知归路 2021-02-01 13:53

I have read a couple of articles about styling the placeholder of an input field using ::-webkit-input-placeholder in HTML5. It works perfectly, except for one thin

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-01 14:29

    Placeholder styles will not resize an input field and will not affect its box model. Add font-size to your input to fix the placeholder from getting cut off.

    You also might consider adding placeholder styles for other browsers...

    ::-moz-placeholder {} /* Firefox 19+ */
    :-moz-placeholder {}  /* Firefox 18- */
    :-ms-input-placeholder {} /* IE */
    

提交回复
热议问题