Select inputs and text inputs in HTML - Best way to make equal width?

前端 未结 3 981
耶瑟儿~
耶瑟儿~ 2020-11-28 19:05

I\'ve got a simple form like so (illustrative purposes only)...

3条回答
  •  无人及你
    2020-11-28 19:36

    The solution is to specify box model for form elements, and browsers tend to agree most when you use border-box:

    input, select, textarea {
      -webkit-box-sizing: border-box;
         -moz-box-sizing: border-box;
              box-sizing: border-box;
    }
    

    There's normalize.css project that aggregates such tricks.

提交回复
热议问题