Advertisement
iteach

LOGIN HTML

Dec 3rd, 2018
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.04 KB | None | 0 0
  1. <html>
  2. <head>
  3. <meta name="viewport" content="width=device-width, initial-scale=1">
  4. <style>
  5. body {font-family: Arial, Helvetica, sans-serif;}
  6.  
  7. /* Full-width input fields */
  8. input[type=text], input[type=password] {
  9. width: 100%;
  10. padding: 12px 20px;
  11. margin: 8px 0;
  12. display: inline-block;
  13. border: 1px solid #ccc;
  14. box-sizing: border-box;
  15. }
  16.  
  17. /* Set a style for all buttons */
  18. button {
  19. background-color: #4CAF50;
  20. color: white;
  21. padding: 14px 20px;
  22. margin: 8px 0;
  23. border: none;
  24. cursor: pointer;
  25. width: 100%;
  26. }
  27.  
  28. button:hover {
  29. opacity: 0.8;
  30. }
  31.  
  32. /* Extra styles for the cancel button */
  33. .cancelbtn {
  34. width: auto;
  35. padding: 10px 18px;
  36. background-color: #f44336;
  37. }
  38.  
  39. /* Center the image and position the close button */
  40. .imgcontainer {
  41. text-align: center;
  42. margin: 24px 0 12px 0;
  43. position: relative;
  44. }
  45.  
  46. img.avatar {
  47. width: 40%;
  48. border-radius: 50%;
  49. }
  50.  
  51. .container {
  52. padding: 16px;
  53. }
  54.  
  55. span.psw {
  56. float: right;
  57. padding-top: 16px;
  58. }
  59.  
  60. /* The Modal (background) */
  61. .modal {
  62. display: none; /* Hidden by default */
  63. position: fixed; /* Stay in place */
  64. z-index: 1; /* Sit on top */
  65. left: 0;
  66. top: 0;
  67. width: 100%; /* Full width */
  68. height: 100%; /* Full height */
  69. overflow: auto; /* Enable scroll if needed */
  70. background-color: rgb(0,0,0); /* Fallback color */
  71. background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
  72. padding-top: 60px;
  73. }
  74.  
  75. /* Modal Content/Box */
  76. .modal-content {
  77. background-color: #fefefe;
  78. margin: 5% auto 15% auto; /* 5% from the top, 15% from the bottom and centered */
  79. border: 1px solid #888;
  80. width: 80%; /* Could be more or less, depending on screen size */
  81. }
  82.  
  83. /* The Close Button (x) */
  84. .close {
  85. position: absolute;
  86. right: 25px;
  87. top: 0;
  88. color: #000;
  89. font-size: 35px;
  90. font-weight: bold;
  91. }
  92.  
  93. .close:hover,
  94. .close:focus {
  95. color: red;
  96. cursor: pointer;
  97. }
  98.  
  99. /* Add Zoom Animation */
  100. .animate {
  101. -webkit-animation: animatezoom 0.6s;
  102. animation: animatezoom 0.6s
  103. }
  104.  
  105. @-webkit-keyframes animatezoom {
  106. from {-webkit-transform: scale(0)}
  107. to {-webkit-transform: scale(1)}
  108. }
  109.  
  110. @keyframes animatezoom {
  111. from {transform: scale(0)}
  112. to {transform: scale(1)}
  113. }
  114.  
  115. /* Change styles for span and cancel button on extra small screens */
  116. @media screen and (max-width: 300px) {
  117. span.psw {
  118. display: block;
  119. float: none;
  120. }
  121. .cancelbtn {
  122. width: 100%;
  123. }
  124. }
  125. </style>
  126. </head>
  127. <body>
  128.  
  129. <h2>Modal Login Form</h2>
  130.  
  131. <button onclick="document.getElementById('id01').style.display='block'" style="width:auto;">Login</button>
  132.  
  133. <div id="id01" class="modal">
  134.  
  135. <form class="modal-content animate" action="/action_page.php">
  136. <div class="imgcontainer">
  137. <span onclick="document.getElementById('id01').style.display='none'" class="close" title="Close Modal">&times;</span>
  138. <img src="img_avatar2.png" alt="Avatar" class="avatar">
  139. </div>
  140.  
  141. <div class="container">
  142. <label for="uname"><b>Username</b></label>
  143. <input type="text" placeholder="Enter Username" name="uname" required>
  144.  
  145. <label for="psw"><b>Password</b></label>
  146. <input type="password" placeholder="Enter Password" name="psw" required>
  147.  
  148. <button type="submit">Login</button>
  149. <label>
  150. <input type="checkbox" checked="checked" name="remember"> Remember me
  151. </label>
  152. </div>
  153.  
  154. <div class="container" style="background-color:#f1f1f1">
  155. <button type="button" onclick="document.getElementById('id01').style.display='none'" class="cancelbtn">Cancel</button>
  156. <span class="psw">Forgot <a href="#">password?</a></span>
  157. </div>
  158. </form>
  159. </div>
  160.  
  161. <script>
  162. // Get the modal
  163. var modal = document.getElementById('id01');
  164.  
  165. // When the user clicks anywhere outside of the modal, close it
  166. window.onclick = function(event) {
  167. if (event.target == modal) {
  168. modal.style.display = "none";
  169. }
  170. }
  171. </script>
  172.  
  173. </body>
  174. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement