Input width with type submit less than input with type text

后端 未结 2 1000
谎友^
谎友^ 2021-01-19 03:52

I don\'t understand why input width with type submit less than input with type text. Could you help me with it?

HTML:

2条回答
  •  鱼传尺愫
    2021-01-19 04:10

    Demo

    The box model being used is different for both the inputs, you can make the box models the same by specifying them box-sizing

    css

    input {
        width: 200px;
        box-sizing: border-box;
        -moz-box-sizing: border-box;
        -webkit-box-sizing: border-box;
    }
    

提交回复
热议问题