博主信息
博文 29
粉丝 0
评论 0
访问量 26570
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
模态框基础
千里马遇伯乐
原创
988人浏览过

模态框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>

本博文版权归博主所有,转载请注明地址!如有侵权、违法,请联系admin@php.cn举报处理!
全部评论 文明上网理性发言,请遵守新闻评论服务协议
0条评论
作者最新博文
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号

  • 登录PHP中文网,和优秀的人一起学习!
    全站2000+教程免费学