How to align an input tag to the center without specifying the width?

后端 未结 7 1536
不思量自难忘°
不思量自难忘° 2020-12-24 11:30

I have these HTML and CSS:

7条回答
  •  梦谈多话
    2020-12-24 11:49

    You can use the following CSS for your input field:

    .center-block {
      display: block;
      margin-right: auto;
      margin-left: auto;
    }
    

    Then,update your input field as following:

    
    

提交回复
热议问题