Advertisement
Guest User

Untitled

a guest
Dec 20th, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.87 KB | None | 0 0
  1. <div class="loginDiv">
  2.  
  3.  
  4. <form id="loginForm">
  5.  
  6. <label>Username:</label>
  7. <input name="userName" type="text"
  8. ng-model="username"
  9. value="{{username}}"
  10. />
  11. <br />
  12.  
  13. <label>Password:</label>
  14. <input name="password" type="text"
  15. ng-model="password"
  16. value="{{password}}"
  17. />
  18. <br />
  19.  
  20. <button ng-click="login(username, password)">Login</button>
  21.  
  22.  
  23. </form>
  24.  
  25.  
  26. </div>
  27.  
  28. .loginDiv {
  29. position: absolute;
  30. width: 300px;
  31. height: 300px;
  32. /* Center form on page horizontally & vertically */
  33. top: 50%;
  34. left: 50%;
  35. margin-top: -150px;
  36. margin-left: -150px;
  37. }
  38.  
  39. .loginForm {
  40. width: 300px;
  41. height: 300px;
  42. background: gray;
  43. border-radius: 10px;
  44. margin: 0;
  45. padding: 0;
  46. }
  47.  
  48. <div class="loginDiv">
  49. <form id="loginForm">
  50. <label>Username:</label>
  51. <input name="userName" type="text"
  52. ng-model="username"
  53. value="{{username}}"
  54. />
  55. <br />
  56. <label>Password:</label>
  57. <input name="password" type="text"
  58. ng-model="password"
  59. value="{{password}}"
  60. />
  61. <br />
  62. <button ng-click="login(username, password)">Login</button>
  63. </form>
  64. </div>
  65.  
  66. .loginDiv {
  67. width: 300px;
  68. height: 300px;
  69. margin: auto;
  70. float: none;
  71. }
  72.  
  73. #loginForm {
  74. width: 300px;
  75. background: gray;
  76. border-radius: 10px;
  77. margin: 0;
  78. padding: 0;
  79. top: 50%;
  80. position: absolute;
  81. }
  82.  
  83. .loginDiv {
  84. display: flex;
  85. align-items: center;
  86. justify-content: center;
  87. position: absolute;
  88. width: 300px;
  89. height: 300px;
  90. top: 50%;
  91. left: 50%;
  92. transform: translate(-50%, -50%);
  93. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement