Placeholder text is not vertically centered in Safari

后端 未结 7 469
挽巷
挽巷 2021-02-02 08:30

Do you have any idea on how to get the placeholder attribute to vertically center in safari? Though when you start typing, the text is perfectly centred.

7条回答
  •  被撕碎了的回忆
    2021-02-02 08:59

    -Safari Solution-

    I got stuck on this issue for a long time despite using

    input::-webkit-input-placeholder { line-height:normal!important; }

    It turns out that having a line-height in the immediate input element was breaking my input::webkit-input-placeholder line-height.

    Solution extended:

    I removed the line-height in my input style and it fixed my issue.

提交回复
热议问题