Blogger Information
Blog 4
fans 0
comment 0
visits 2046
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
固定定位以及三行三列的定位布局
wan-PHP
Original
508 people have browsed it

1.在线QQ客服的固定定位

  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  6. <meta name="viewport" content="width=qq, initial-scale=1.0" />
  7. <title>qq</title>
  8. <style>
  9. .box {
  10. height: 15vh;
  11. width: 40vw;
  12. background-color: skyblue;
  13. position: absolute;
  14. }
  15. </style>
  16. </head>
  17. <body>
  18. <div class="box">
  19. <img src="q.png" alt="qq" width="190" height="60" />
  20. </div>
  21. </body>
  22. </html>
  23. `

2.三行三列的定位布局

  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  6. <meta name="viewport" content="width=`, initial-scale=1.0" />
  7. <title>三行三列</title>
  8. <style>
  9. * {
  10. margin: 0;
  11. padding: 0;
  12. box-sizing: border-box;
  13. }
  14. html {
  15. font-size: 10px;
  16. }
  17. body {
  18. font-size: 1.6rem;
  19. }
  20. header,
  21. footer {
  22. height: 6rem;
  23. background-color: royalblue;
  24. text-align: center;
  25. }
  26. .container {
  27. margin: 0.1rem 0;
  28. background-color: olivedrab;
  29. min-height: calc(100vh - 12.2rem);
  30. position: relative;
  31. text-align: center;
  32. }
  33. .container aside {
  34. width: 20rem;
  35. min-height: inherit;
  36. position: absolute;
  37. background-color: orange;
  38. }
  39. .container aside:first-of-type {
  40. left: 0;
  41. top: 0;
  42. background-color: red;
  43. }
  44. .container aside:last-of-type {
  45. right: 0;
  46. top: 0;
  47. }
  48. .container main {
  49. position: absolute;
  50. left: 20.5rem;
  51. right: 20.5rem;
  52. min-height: inherit;
  53. }
  54. </style>
  55. </head>
  56. <body>
  57. <header>页眉</header>
  58. <div class="container">
  59. <aside>左侧</aside>
  60. <main>内容区</main>
  61. <aside>右侧</aside>
  62. </div>
  63. <footer>页脚</footer>
  64. </body>
  65. </html>

Correcting teacher:PHPzPHPz

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!