How to make input element with 5px fill fill all <td>?
4 answers
I asked this question back in 2010, and as far as I remember, then there was no reasonable solution.
However, thanks to CSS3, two solutions are now available:
Use box-sizing
box-sizing: border-box;
width: 100%;
Use calc
width: calc(100% - 10px);
(, width: -moz-calc(100% - 10px);).
+6
. http://www.w3schools.com/css/css_boxmodel.asp
, , css , .
, 100%, - 5 , 100% + 5 .
, , td, , , , :
<input type="text" style="width:100%; padding-left:0px; padding-right:0px;"/>
Another approach would be to use a slightly lower percentage, such as 95% or 90%.
0