Blogger Information
Blog 29
fans 0
comment 0
visits 19534
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
模态框基础
千里马遇伯乐
Original
791 people have browsed it

模态框css部分

  1. <style type="text/css">
  2. * {
  3. margin: 0px;
  4. padding: 0px;
  5. box-sizing: border-box;
  6. }
  7. .box1 {
  8. width: 100%;
  9. height: 60px;
  10. background: brown;
  11. color: white;
  12. padding: 8px 16px;
  13. }
  14. .box1 h1 {
  15. padding-top: 15px;
  16. font-size: 25px;
  17. text-align: center;
  18. letter-spacing:10px;
  19. }
  20. .box1 button {
  21. position: fixed;
  22. right: 0;
  23. }
  24. /* .box2{
  25. display: none;
  26. } */
  27. .box2 input{
  28. width: 220px;
  29. height: 27px;
  30. border: 1px solid blue;
  31. border-radius: 5px;
  32. margin-left: 70px;
  33. }
  34. .btu {
  35. width: 220px;
  36. height: 26px;
  37. /* 去掉边框 */
  38. border: none;
  39. /* 设置圆角 */
  40. border-radius: 5px;
  41. background: seagreen;
  42. color: white;
  43. /* 外边距向左侧移动 */
  44. margin-left: 100px;
  45. margin-top: 15px;
  46. margin-bottom: 15px;
  47. }
  48. /* 模态框 */
  49. .box2 fieldset {
  50. border-radius: 5px;
  51. border: none;
  52. width: 400px;
  53. height:300px ;
  54. background: rgb(243, 244, 245);
  55. /* 固定定位 */
  56. position: fixed;
  57. top: 200px;
  58. left: 600px;
  59. /* 模态框居中 */
  60. vertical-align:middle;
  61. }
  62. /* <!-- 半透明框 --> */
  63. .box3 {
  64. /* 固定定位 */
  65. position: fixed;
  66. /* 定位四个角 全部清零 */
  67. top: 0;
  68. left: 0;
  69. right: 0;
  70. bottom: 0;
  71. background-color:#042d53;
  72. /* 半透明 */
  73. opacity: 0.5;
  74. }
  75. .box2 p {
  76. font-weight: 100%;
  77. font-size: 20px;
  78. color: #1b0212;
  79. background-color: chartreuse;
  80. text-align: center;
  81. font: 2em sans-serif;
  82. }
  83. .box4 input {
  84. background-color: rgb(241, 243, 241);
  85. margin-top: 15px;
  86. /* 输入框居中 */
  87. vertical-align:middle;
  88. margin-left: 100px;
  89. }
  90. </style>

模态框HTML部分

  1. <body >
  2. <div class="box1">
  3. <h1>后台管理系统</h1>
  4. <button>登录</button>
  5. </div>
  6. <!-- 模态框 -->
  7. <div class="box2">
  8. <!-- 半透明框 -->
  9. <div class="box3"></div>
  10. <form ction="">
  11. <fieldset>
  12. <div class="box4">
  13. <p>登录到后台管理系统</p><br>
  14. <input type="tetx" name="username" placeholder="用户名" /><br>
  15. <input type="password" name="password" placeholder="密码"><br>
  16. <button class="btu">登录</button>
  17. </div>
  18. </di>
  19. </fieldset>
  20. </form>
  21. </body>

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post