<!DOCTYPE html>
<html>
<head>
<title>Test</title>
<style type='text/css'>
body > div {
width:400px;
}
.row {
display:table-row;
}
.row input[type=text]{
width:100%;
}
.row div:first-child {
display:table-cell; white-space:nowrap;
}
.row div:nth-child(2){
display:table-cell;
width:100%;
padding-right:4px;
}
.row div:nth-child(3){
width:40px;
}
</style>
</head>
<body>
<div>
<div class='row'>
<div>Floating size</div>
<div>
<input type='text'/>
</div>
<div>40px;</div>
</div>
</div>
<div>
<div class='row'>
<div>Really Floating size</div>
<div>
<input type='text'/>
</div>
<div>40px;</div>
</div>
</div>
</body>
</html>
* This source code was highlighted with Source Code Highlighter.