Positioning label when using labeled control - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Position

Description

Positioning label when using labeled control

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">
label input {
   display:block;
}

label {<!--  w ww.  j a  va  2 s.  c  o m-->
   display:inline-block;
}

p * {
   vertical-align:top;
}
</style> 
 </head> 
 <body> 
  <form> 
   <p>Lorem ipsum d<label class="label__fill-in"> <input type="text" class="fill-in" maxlength="30">Lorem ipsum d</label>Lorem ipsum</p> 
  </form>  
 </body>
</html>

Related Tutorials