Multiple number inputs with different widths - HTML CSS CSS Form

HTML CSS examples for CSS Form:input

Description

Multiple number inputs with different widths

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">
.input1 {<!--from   ww  w  . ja  v a 2  s .c  o  m-->
   width:51px;
   background:yellow;
}

.input2 {
   width:100px;
   background:yellow;
}

.input3 {
   width:151px;
   background:yellow;
}

.input4 {
   width:201px;
   background:yellow;
}

.input5 {
   width:251px;
   background:yellow;
}

input[placeholder="input1"] {
   width:51px;
   background:blue;
}

input[placeholder="input2"] {
   width:100px;
   background:blue;
}

input[placeholder="input3"] {
   width:151px;
   background:blue;
}

input[placeholder="input4"] {
   width:201px;
   background:blue;
}

input[placeholder="input5"] {
   width:251px;
   background:blue;
}

input:nth-child(14) {
   width:51px;
   background:Chartreuse;
}

input:nth-child(15) {
   width:100px;
   background:yellow;
}

input:nth-child(16) {
   width:151px;
   background:blue;
}

input:nth-child(17) {
   width:201px;
   background:pink;
}

input:nth-child(18) {
   width:251px;
   background:OrangeRed;
}
</style> 
 </head> 
 <body> 
  <h4>Lorem ipsum dolor sit amet</h4> 
  <input type="text" class="input1"> 
  <input type="text" class="input2"> 
  <input type="text" class="input3"> 
  <input type="text" class="input4"> 
  <input type="text" class="input5"> 
  <h4>Lorem ipsum dolor sit am</h4> 
  <input type="text" placeholder="input1"> 
  <input type="text" placeholder="input2"> 
  <input type="text" placeholder="input3"> 
  <input type="text" placeholder="input4"> 
  <input type="text" placeholder="input5"> 
  <h4>Lorem ipsum dolor sit </h4> 
  <input type="text"> 
  <input type="text"> 
  <input type="text"> 
  <input type="text"> 
  <input type="text">  
 </body>
</html>

Related Tutorials