Solution moderne avec la propriété CSS box-sizing
:
1 2 3 4 5 |
input { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } |
Solution obsolète :
Source : Input field and submit button on the same line, full width.
1 2 3 4 5 6 |
<form> <button>Ok</button> <div class="input-wrapper"> <input type="text" /> </div> </form> |
1 2 3 4 5 6 7 8 9 10 |
button { float: right; } .input-wrapper { overflow: hidden; padding-right: 15px; } input { width: 100%; } |