登录  /  注册
博主信息
博文 43
粉丝 0
评论 3
访问量 34919
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
模态框简单编写
Time
原创
670人浏览过

模态框

图片展示:

1
2
3
4

css代码:

  1. /* 初始化 */
  2. * {
  3. margin: 0;
  4. padding: 0;
  5. box-sizing: border-box;
  6. }
  7. /* 头部 */
  8. /* background-color:greenyellow; */
  9. header {
  10. background-color: greenyellow;
  11. padding: 0.5em 1em;
  12. display: flex;
  13. }
  14. /* logo */
  15. header .title {
  16. font-weight: lighter;
  17. font-style: italic;
  18. color: white;
  19. letter-spacing: 2px;
  20. text-shadow: 1px 1px 1px #555;
  21. }
  22. /* 登录按钮 */
  23. header button {
  24. margin-left: auto;
  25. width: 5em;
  26. border: none;
  27. border-radius: 0.5em;
  28. }
  29. header button:hover {
  30. cursor: pointer;
  31. background-color: coral;
  32. color: #fff;
  33. box-shadow: 0 0 2px 2px #fff;
  34. transition: 1s;
  35. }
  36. /* 模态框 */
  37. .modal .modal-form fieldset {
  38. height: 15.5em;
  39. background-color: rgb(131, 240, 116);
  40. border: none;
  41. padding: 2em 3em;
  42. box-shadow: 0 0 5px #888;
  43. }
  44. /* 模态框表单标题 */
  45. .modal .modal-form fieldset legend {
  46. padding: 7px 1.5em;
  47. background-color: greenyellow;
  48. color: white;
  49. }
  50. .modal .modal-form fieldset input {
  51. height: 3em;
  52. padding-left: 1em;
  53. outline: none;
  54. border: 1px solid #ddd;
  55. font-size: 14px;
  56. }
  57. /* :focus: 表单控件,获取焦点时的样式 */
  58. .modal .modal-form fieldset input:focus {
  59. box-shadow: 0 0 8px #888;
  60. border: none;
  61. }
  62. .modal .modal-form fieldset button {
  63. background-color: greenyellow;
  64. color: white;
  65. border: none;
  66. height: 3em;
  67. font-size: 16px;
  68. height: 2.5em;
  69. }
  70. .modal .modal-form fieldset button:hover {
  71. background-color: coral;
  72. cursor: pointer;
  73. }
  74. /* 定位 */
  75. .modal .modal-form {
  76. position: fixed;
  77. top: 10em;
  78. left: 35em;
  79. right: 38em;
  80. }
  81. /* 遮罩 */
  82. .modal .modal-bg {
  83. position: fixed;
  84. /* 坐标全部清0,请定位到四个顶点 */
  85. top: 0;
  86. left: 0;
  87. right: 0;
  88. bottom: 0;
  89. background-color: rgb(0, 0, 0, 0.5);
  90. }
  91. .modal {
  92. display: none;
  93. }
批改老师:PHPzPHPz

批改状态:合格

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

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

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