Blogger Information
Blog 8
fans 1
comment 0
visits 6632
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
在线QQ客服的固定定位以及三行三列的定位布局
JOAblog
Original
601 people have browsed it

在线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. </head>
  9. <style>
  10. body{
  11. position: relative;
  12. }
  13. .qq{
  14. position:fixed;
  15. bottom: 5rem;
  16. right: 1rem;
  17. }
  18. </style>
  19. <body>
  20. <div class="qq">
  21. <a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=2274666983&site=qq&menu=yes"><img border="0" src="http://wpa.qq.com/pa?p=2:2274666983:51" alt="点击这里给我发消息" title="点击这里给我发消息"/></a>
  22. </div>
  23. </body>
  24. </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. </head>
  9. <style>
  10. * {
  11. margin: auto;
  12. padding: auto;
  13. font-size: 10px;
  14. }
  15. body {
  16. min-width: 10rem;
  17. }
  18. .zhudiv {
  19. position: relative;
  20. }
  21. .head {
  22. height: 2rem;
  23. background-color: aquamarine;
  24. }
  25. .foot {
  26. width: 100%;
  27. height: 2rem;
  28. background-color: aquamarine;
  29. position: fixed;
  30. bottom: 0;
  31. }
  32. .zuo {
  33. width: 10rem;
  34. position: fixed;
  35. right: ;
  36. margin: 1px;
  37. top: 2rem;
  38. bottom: 2rem;
  39. background-color: blueviolet;
  40. }
  41. .zhon {
  42. position:fixed;
  43. right: 10rem;
  44. left: 10rem;
  45. margin: 1px;
  46. top: 2rem;
  47. bottom: 2rem;
  48. background-color: coral;
  49. }
  50. .you {
  51. width: 10rem;
  52. position: fixed;
  53. right: 0;
  54. margin: 1px;
  55. top: 2rem;
  56. bottom: 2rem;
  57. background-color: blueviolet;
  58. }
  59. </style>
  60. <body>
  61. <div class="zhudiv">
  62. <div class="head"></div>
  63. <div>
  64. <div class="zuo">左手</div>
  65. <div class="zhon">身体</div>
  66. <div class="you">右手</div>
  67. </div>
  68. <div class="foot"></div>
  69. </div>
  70. </body>
  71. </html>

总结:在内容区关于左中右区块,自己的思想是每一个盒子都要设置宽度,但是被老师点一下后,才明白有一些是可以不用宽度的,get到了,思想不能太死板··

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