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

前端 未结 14 1796
别那么骄傲
别那么骄傲 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:04

    The problem lies in border-width of input element. Shortly, try setting the margin-left of the input element to -2px.

    table input {
      margin-left: -2px;
    }
    

提交回复
热议问题