Center HTML Input Text Field Placeholder

前端 未结 10 1837
半阙折子戏
半阙折子戏 2020-11-28 03:53

How can I centre the input field\'s placeholder\'s alignment in a html form?

I am using the following code, but it doesn\'t work:

CSS ->

inpu         


        
10条回答
  •  感情败类
    2020-11-28 04:51

    By using the code snippet below, you are selecting the placeholder inside your input, and any code placed inside will affect only the placeholder.

    input::-webkit-input-placeholder {
          text-align: center
    }
    

提交回复
热议问题