Blogger Information
Blog 4
fans 4
comment 0
visits 2564
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
固定定位,三行三列定位布局
逆旅行人
Original
700 people have browsed it

作业内容:

1. 制作一个在线QQ客服的固定定位(QQ客服用图片就行);

  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: 0px;
  11. padding: 0px;
  12. box-sizing: border-box;
  13. }
  14. body{
  15. /* position: relative; */
  16. }
  17. div img{
  18. position: fixed;
  19. right: 0px;
  20. top: 30px;
  21. }
  22. div{
  23. width: 100%;
  24. height: 10000px;
  25. background-color: brown;
  26. }
  27. </style>
  28. </head>
  29. <body>
  30. <div><img src="./1.png" alt=""></div>
  31. </body>
  32. </html>

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=device-width, initial-scale=1.0" />
  7. <title>三行三列布局</title>
  8. </head>
  9. <style>
  10. :root{
  11. font-size: 10px;
  12. }
  13. *{
  14. margin: 0px;
  15. padding: 0px;
  16. box-sizing: border-box;
  17. }
  18. body{
  19. font-size: 16px;
  20. }
  21. footer,header{
  22. height: 5em;
  23. background-color: thistle;
  24. }
  25. .container{
  26. min-height: calc(100vh - 2 * 5em - 2 * 1rem);
  27. background-color: tomato;
  28. position: relative;
  29. margin:1rem 0px;
  30. }
  31. .container aside{
  32. width: 20rem;
  33. min-height: inherit;
  34. position: absolute;
  35. }
  36. .container aside:first-child{
  37. background-color: wheat;
  38. top: 0px;
  39. left: 0px;
  40. }
  41. .container aside:last-child{
  42. background-color: yellowgreen;
  43. top: 0px;
  44. right: 0px;
  45. }
  46. .container main{
  47. min-height: inherit;
  48. background-color: blueviolet;
  49. position: absolute;
  50. top: 0px;
  51. left: 21rem;
  52. right: 21rem;
  53. margin: 0rem 1rem;
  54. }
  55. </style>
  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>

3. 将之前落下的作业补齐;

4. 在mdn上预习flex和js的知识,下周要学习.

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