Aligning text for input field label - HTML CSS HTML Tag

HTML CSS examples for HTML Tag:input text

Description

Aligning text for input field label

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <style>
label<!--  www. ja v  a2 s  .  c o m-->
 {
   width:6em;
   float:left;
   text-align:right;
   margin-right:2em;
   display:block
}

.submit input
 {
   margin-left:5.6em;
}
</style> 
 </head> 
 <body> 
  <form action="#"> 
   <p> <label for="name">Name</label> <input type="text" id="name"> </p> 
   <p> <label for="e-mail">E-mail</label> <input type="text" id="e-mail"> </p> 
   <p class="submit"> <input type="submit" value="Submit"> </p> 
  </form>  
 </body>
</html>

Related Tutorials