Indent label value into form field


/ Published in: CSS
Save to your folder(s)



Copy this code and paste it in your HTML
  1. fieldset {
  2. border: none;
  3.  
  4. /* trick */
  5. position: relative;
  6. }
  7.  
  8. label
  9. {
  10. font-family: Helvetica,arial,sans-serif;
  11. font-size: 15px;
  12. font-weight: bold;
  13. color: #9F0000;
  14.  
  15. /* trick */
  16. left:10px;
  17. top:9px;
  18. position:absolute;
  19. }
  20.  
  21. input[type="text"]
  22. {
  23. border:1px solid #CCCCCC;
  24. display: block;
  25. color:#516064;
  26. font-family: Helvetica,arial,sans-serif;
  27. font-size:16px;
  28. margin-bottom:20px;
  29. padding:8px;
  30. width:400px;
  31.  
  32. /* trick */
  33. text-indent:75px;
  34. }

URL: http://aext.net/2010/02/css-text-indent-style-your-html-form/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.