Text input with 100% width inside a td expands/continues outside the td

前端 未结 5 1605
Happy的楠姐
Happy的楠姐 2020-12-23 20:22

Here is the live demo

I\'m trying to put a padded text input inside a td, and I want it to occupy 100% of the width, but it goes outside of the td. I don\'t underst

5条回答
  •  攒了一身酷
    2020-12-23 21:20

    you can use box-sizing property for this because padding add width in your input field .

    CSS:

    input {
        -moz-box-sizing: border-box;
        -webkit-box-sizing: border-box;
         box-sizing: border-box;
        padding: 10px;
    }
    

    but it's not working IE7

提交回复
热议问题