Stretch an input properly - HTML CSS CSS Form

HTML CSS examples for CSS Form:input

Description

Stretch an input properly

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">
ul {<!--   ww  w .  ja  v  a2s.  c  om-->
   width:96%;
   border:2px solid Chartreuse;
   font-family:tahoma;
   padding:6px;
}

li {
   background-color:yellow;
   margin:3px;
   padding:4px;
   position:relative;
}

input, span {
   display:block;
   position:absolute;
   left:100px;
   right:0px;
   border:2px solid blue;
   top:4px;
   background:pink;
   width:auto;
}
</style> 
 </head> 
 <body> 
  <ul> 
   <li>Lorem i<span>Lore</span> </li> 
   <li>Lorem i<span style="border:0px"> <input style="width:100%;left:0px" value="I know that I can do this but I need the one below to work without being wrapped"> </span> </li> 
   <li>Lorem i<span style="border:0px"> <input style="width:100%;left:0px;white-space:nowrap;"> </span> </li> 
  </ul>  
 </body>
</html>

Related Tutorials