Align select and input elements on a form - HTML CSS CSS Form

HTML CSS examples for CSS Form:Form

Description

Align select and input elements on a form

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 {<!--from   www . ja v  a2 s . c o m-->
   height:100px;
   background-color:Chartreuse;
}

li {
   float:left;
   list-style-type:none;
   margin-top:21px;
}

#li1 {
   width:251px;
}

h4 {
   margin:0;
}
</style> 
 </head> 
 <body> 
  <ul> 
   <li id="li1"> <h4>Lorem ipsum dolor</h4> <input text-align="top" name="configuration[targets_attributes][0][name]" id="configuration_targets_attributes_0_name" size="30" value="bob" type="text"> </li> 
   <li id="configuration_targets_attributes_0_maximum_fte_input" class="select input required"> <h4>Lorem ipsum d</h4> <select id="configuration_targets_attributes_0_maximum_fte" name="configuration[targets_attributes][0][maximum_fte]"> <option value="1.0" selected>Lor</option> <option value="0.9">Lor</option> <option value="0.8">Lor</option> </select> </li> 
  </ul>  
 </body>
</html>

Related Tutorials