Make validation message appear next to the input field - HTML CSS CSS Form

HTML CSS examples for CSS Form:input

Description

Make validation message appear next to the input field

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">
@CHARSET "UTF-8";
#reg-form {<!--  www.j  a v a 2  s . c  om-->
   display:block;
   width:601px;
}

#reg-form li {
   width:181px;
   display:inline-block;
   padding:6px 6px;
}

#reg-form li label {
   width:151px;
   float:left;
}

.status {
   font-size:15px;
   color:Chartreuse;
   display:inline;
}

#register-user {
   float:left;
   margin-left:8px;
   padding:6px 6px 6px 6px;
}
</style> 
 </head> 
 <body> 
  <ul id="reg-form"> 
   <li> <label for="id_username">Lorem ips</label> <input id="id_username" type="text" name="username" maxlength="30"> </li> 
   <div class="status">
     Lorem ipsum dolo 
   </div> 
   <br> 
   <li> <label for="id_pass">Lorem ips</label> <input id="id_pass" type="text" name="pass" maxlength="30"> </li> 
   <div class="status">
     Lorem ipsum dolor 
   </div> 
  </ul>  
 </body>
</html>

Related Tutorials