博主信息
博文 12
粉丝 0
评论 0
访问量 9294
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
在线客服固定定位和三行三列布局
番茄炒蛋
原创
712人浏览过

在线客服固定定位

效果

代码

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  7. <title>Document</title>
  8. <style>
  9. * {
  10. margin: 0;
  11. padding: 0;
  12. }
  13. img {
  14. position: fixed;
  15. right: 0;
  16. top: 20em;
  17. }
  18. </style>
  19. </head>
  20. <body bgcolor="#2c3e50">
  21. <img src="./img/QQ截图20210705155538.png" alt="" />
  22. </body>
  23. </html>

三行三列布局

效果

代码

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  7. <title>Document</title>
  8. <style>
  9. * {
  10. margin: 0;
  11. padding: 0;
  12. box-sizing: border-box;
  13. text-align: center;
  14. color: white;
  15. font-size: 30px;
  16. font-weight: bold;
  17. }
  18. html {
  19. font-size: 10px;
  20. }
  21. body {
  22. font-size: 1.6rem;
  23. }
  24. header {
  25. height: 5rem;
  26. background-color: #e74645;
  27. }
  28. footer {
  29. height: 5rem;
  30. background-color: #fb7756;
  31. }
  32. main {
  33. margin: 0.5rem 0;
  34. min-height: calc(100vh - 11rem);
  35. position: relative;
  36. }
  37. aside {
  38. width: 20rem;
  39. min-height: inherit;
  40. position: absolute;
  41. }
  42. aside:first-of-type {
  43. background-color: #facd60;
  44. left: 0;
  45. top: 0;
  46. }
  47. aside:last-of-type {
  48. background-color: #1ac0c6;
  49. right: 0;
  50. top: 0;
  51. }
  52. .main {
  53. position: absolute;
  54. min-height: inherit;
  55. background-color: #34495e;
  56. left: 21rem;
  57. right: 21rem;
  58. }
  59. </style>
  60. </head>
  61. <body>
  62. <header>头部</header>
  63. <main>
  64. <aside>左侧</aside>
  65. <div class="main">主题</div>
  66. <aside>右侧</aside>
  67. </main>
  68. <footer>底部</footer>
  69. <script></script>
  70. </body>
  71. </html>
批改老师:天蓬老师天蓬老师

批改状态:合格

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

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

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