Blogger Information
Blog 12
fans 0
comment 0
visits 6738
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
在线客服固定定位和三行三列布局
番茄炒蛋
Original
540 people have browsed it

在线客服固定定位

效果

代码

  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>
Correcting teacher:天蓬老师天蓬老师

Correction status:qualified

Teacher's comments:
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