Getting an input to fill remaining width like a span element - HTML CSS CSS Form

HTML CSS examples for CSS Form:input

Description

Getting an input to fill remaining width like a span element

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">
.a {<!--from   w ww  . j a  va  2  s  . co m-->
   display:table-cell;
   background-color:Chartreuse;
}

.b {
   background-color:yellow;
   display:table-cell;
   width:100%;
}

.c {
   width:100%;
}
</style> 
 </head> 
 <body> 
  <div> 
   <span class="a">Lorem ips</span> 
   <span class="b">Lorem ipsum d</span> 
  </div> 
  <div> 
   <span class="a">Lorem ips</span> 
   <span class="b"> <input class="c" value="fill the rest"> </span> 
  </div>  
 </body>
</html>

Related Tutorials