模态框

  1. <style>
  2. * {
  3. padding: 0;
  4. margin: 0;
  5. user-select: none;
  6. box-sizing: border-box;
  7. }
  8. body {
  9. display: flex;
  10. justify-content: center;
  11. align-items: center;
  12. height: 100vh;
  13. }
  14. button {
  15. outline: 0;
  16. width: 150px;
  17. height: 60px;
  18. color: rgb(89, 89, 233);
  19. border-radius: 6px;
  20. border: 2px solid rgb(43, 238, 205);
  21. background-color:rgb(209, 183, 183);
  22. transition: all 0.3s;
  23. cursor: pointer;
  24. }
  25. button:hover {
  26. color:rgb(247, 233, 233);
  27. border-color: rgb(126, 126, 192);
  28. background-color: rgb(45, 45, 226);
  29. }
  30. .model-box {
  31. display: none;
  32. position: absolute;
  33. top: 0;
  34. left: 0;
  35. width: 100%;
  36. height: 100vh;
  37. background-color: rgba(0, 0, 0, 0.45);
  38. }
  39. .content {
  40. display: none;
  41. position: absolute;
  42. top: 100px;
  43. left: calc(50% - 210px);
  44. width: 420px;
  45. height: 350px;
  46. border-radius: 10px;
  47. padding: 0 20px;
  48. box-shadow: 0 2px 12px rgba(116, 65, 65, 0.2);
  49. background-color: rgb(102, 93, 93);
  50. }
  51. .content .title {
  52. display: flex;
  53. justify-content: space-between;
  54. height: 60px;
  55. line-height: 60px;
  56. }
  57. .content .title span {
  58. font-size: 18px;
  59. color: rgb(224, 166, 166);
  60. }
  61. .content .title i {
  62. font-style: normal;
  63. font-size: 24px;
  64. color: rgb(241, 220, 220, 0.322);
  65. cursor: pointer;
  66. }
  67. .content .title i:hover {
  68. color: rgb(37, 37, 206);
  69. }
  70. .content form .form-input {
  71. margin: 22px 0;
  72. }
  73. .content form .form-input label {
  74. font-size: 15px;
  75. color: rgb(236, 241, 236);
  76. cursor: pointer;
  77. }
  78. .content form .form-input input {
  79. outline: 0;
  80. width: 100%;
  81. height: 24px;
  82. padding: 0 15px;
  83. margin-top: 20px;
  84. border: 1px solid rgb(78, 72, 72)
  85. border-radius: 4px;
  86. }
  87. .content form .form-input button {
  88. float: right;
  89. }
  90. </style>
  91. </head>
  92. <body>
  93. <button
  94. onclick="document.querySelector('.model-box').style.display='block';document.querySelector('.content').style.display='block'"
  95. >
  96. 登录
  97. </button>
  98. <div
  99. class="model-box"
  100. onclick="document.querySelector('.model-box').style.display='none';document.querySelector('.content').style.display='none'"
  101. ></div>
  102. <div class="content">
  103. <div class="title">
  104. <span>登录窗口</span>
  105. <i
  106. onclick="document.querySelector('.model-box').style.display='none';document.querySelector('.content').style.display='none'"
  107. >x</i
  108. >
  109. </div>
  110. <form action="">
  111. <div class="form-input">
  112. <label for="username">用户名</label>
  113. <input type="text" id="username" />
  114. </div>
  115. <div class="form-input">
  116. <label for="password">密码</label>
  117. <input type="text" id="password" />
  118. </div>
  119. <div class="form-input">
  120. <button>登录</button>
  121. </div>
  122. <div class="form-input">
  123. <button>找回密码</button>
  124. </div>
  125. </form>
  126. </div>
  127. </body>

效果图

flex grid

更多相关文章

  1. 制作简易模态框登录页面及flex与grid整理总结
  2. Laravel 实现登录
  3. 意派Epub360丨这款教师节交互小游戏H5模板超有趣!快来借鉴学习!
  4. 动态分页制作及composer自动加载及第三方验证码使用
  5. 补0819作业:实现预处理与会话跟踪 及 登录防sql注入
  6. 实例演绎pdo在用户登录环节是怎么防sql注入及实战预处理与会话跟
  7. flex布局中容器及项目常用属性演示
  8. 表单的制作
  9. CSS基本选择器与上下文选择器

随机推荐

  1. android 手势识别
  2. Android中RadioGroup组与onCheckedChange
  3. Android Studio无法执行Java类的main方法
  4. Android 实现在Java代码中修改UI界面,并修
  5. Android API Differences Report
  6. Android ApiDemos示例解析(100):Views->A
  7. CreateProcess error=2, 系统找不到指定
  8. Android添加单元测试的方法与步骤
  9. Android SDK的docs访问速度很慢
  10. android添加超级管理权限