Fluid width of input element - HTML CSS CSS Form

HTML CSS examples for CSS Form:input

Description

Fluid width of input 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">
.top {
   position:fixed;
   margin:0;
   padding:0;
   top:0;
   height:51px;
   width:100%;
   background:yellow;
   vertical-align:middle;<!--from  ww w .  jav a 2  s  .  co m-->
}

.whatever {
   background:red;
   width:235px;
   float:left;
   line-height:51px;
}

.input {
   overflow:hidden;
}

.input input {
   background:green;
   width:100%;
   height:51px;
   border:0;
   outline:0;
   -moz-box-sizing:border-box;
   box-sizing:border-box;
}
</style> 
 </head> 
 <body> 
  <div class="top"> 
   <div class="whatever">
     Lorem ipsum dolor sit 
   </div> 
   <div class="input"> 
    <input value="Some value"> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials