Advertisement
Guest User

Untitled

a guest
Dec 19th, 2014
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.73 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>JS Bin</title>
  6. <style id="jsbin-css">
  7. .cont {
  8. width: 300px;
  9. margin: 100px auto 0;
  10. background: #000;
  11. }
  12. .text-edit {
  13. position: relative;
  14. height: 50px;
  15. width: 200px;
  16. }
  17. .text-edit > input {
  18. width: 100%;
  19. height: 66%;
  20. padding: 5px;
  21. box-sizing: border-box;
  22. position: absolute;
  23. border: none;
  24. border-bottom: 1px solid #888;
  25. outline: none;
  26. bottom: 0;
  27. transition: all .25s;
  28. }
  29. .text-edit > input:focus {
  30. border-color: #ff5722;
  31. }
  32. .text-edit > input:focus + label {
  33. top: 3px;
  34. font-size: 12px;
  35. color: #ff5722;
  36. }
  37. .text-edit > label {
  38. position: absolute;
  39. top: 24px;
  40. left: 3px;
  41. color: #888;
  42. cursor: text;
  43. transition: all .25s;
  44. }
  45. </style>
  46. </head>
  47. <body>
  48. <div class="cont">
  49. <div class="text-edit">
  50. <input id="text-1" type="text">
  51. <label for="text-1">Имя</label>
  52. </div>
  53. <div class="text-edit">
  54. <input type="text" id="text-2">
  55. <label for="text-2">Пароль</label>
  56. </div>
  57. </div>
  58.  
  59.  
  60. <script id="jsbin-source-css" type="text/css">@blue: #2271d2;
  61. @orange: #ff5722;
  62.  
  63. .cont {
  64. width: 300px;
  65. margin: 100px auto 0;
  66. background: #000;
  67. }
  68.  
  69. .text-edit {
  70. position: relative;
  71. height: 50px;
  72. width: 200px;
  73. > input {
  74. width: 100%;
  75. height: 66%;
  76. padding: 5px;
  77. box-sizing: border-box;
  78. position: absolute;
  79. border: none;
  80. border-bottom: 1px solid #888;
  81. outline: none;
  82. bottom: 0;
  83. transition: all .25s;
  84. &:focus {
  85. border-color: @orange;
  86. + label {
  87. top: 3px;
  88. font-size: 12px;
  89. color: @orange;
  90. }
  91. }
  92. }
  93. > label {
  94. position: absolute;
  95. top: 24px;
  96. left: 3px;
  97. color: #888;
  98. cursor: text;
  99. transition: all .25s;
  100. }
  101. }</script>
  102. </body>
  103. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement