HTML input textbox with a width of 100% overflows table cells

前端 未结 14 1506
别那么骄傲
别那么骄傲 2021-01-29 20:28

Does anyone know why the input elements with a width of 100% go over the table\'s cells border.

In the simple example below input box go over the table\'s cells border,

14条回答
  •  时光说笑
    2021-01-29 21:10

    I solved the problem by using this

    tr td input[type=text] {
      width: 100%;
      box-sizing: border-box;
      -webkit-box-sizing:border-box;
      -moz-box-sizing: border-box;
      background:transparent !important;
      border: 0px;
    }
    

提交回复
热议问题