PHP8.1.21版本已发布
vue8.1.21版本已发布
jquery8.1.21版本已发布

博客列表 > 前端作业-在线QQ客服的固定定位&三行三列的定位布局

前端作业-在线QQ客服的固定定位&三行三列的定位布局

︷肉園耔︷
︷肉園耔︷ 原创
2021年07月08日 00:42:50 508浏览
  • 作业1: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. padding: 0;
  11. margin: 0;
  12. }
  13. .kh{
  14. width: 150px;
  15. height: 170px;
  16. margin: 100px 140px;
  17. }
  18. .kh ul li{
  19. list-style:none;
  20. }
  21. .kh .left{
  22. display: inline-block;
  23. width: 31px;
  24. height: 170px;
  25. background-color: red;
  26. position: relative;
  27. color: white;
  28. }
  29. .kh .left li{
  30. position: absolute;
  31. top: 6%;
  32. left: 6px;
  33. }
  34. .kh .left li img{
  35. position: absolute;
  36. top: 95px;
  37. left: -3px;
  38. right: 0px;
  39. width: 25px;
  40. height: 20px;
  41. }
  42. .kh .right{
  43. display: inline-block;
  44. float:right;
  45. width: 119px;
  46. position: relative;
  47. }
  48. .kh .right li{
  49. text-align: center;
  50. font-size: 6px;
  51. }
  52. .kh .right li img{
  53. width: 30px;
  54. height: 33px;
  55. text-align: center;
  56. }
  57. </style>
  58. </head>
  59. <body>
  60. <div class="kh">
  61. <ul class="left">
  62. <li>在线客服</li>
  63. <li><img src="./demo8/信息.png" alt=""></li>
  64. </ul>
  65. <ul class="right">
  66. <li><img src="./demo8/QQ.png" alt=""></li>
  67. <li>QQ客服</li>
  68. <br>
  69. <li><img src="./demo8/电话.png" alt=""></li>
  70. <li>4000-121-929</li>
  71. <li>(7 X 24小时)</li>
  72. </ul>
  73. </div>
  74. </body>
  75. </html>
  • 作业2 三行三列的定位布局

— 图例

— 代码

  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. padding: 0;
  11. margin: 0;
  12. box-sizing: border-box;
  13. }
  14. header {
  15. background-color: red;
  16. width: 400px;
  17. text-align: center;
  18. }
  19. .zt{
  20. width: 400px;
  21. height: 200px;
  22. background-color:burlywood;
  23. position: relative;
  24. text-align: center;
  25. }
  26. .zt div {
  27. width: 40px;
  28. height: 200px;
  29. position:absolute;
  30. text-align: center;
  31. }
  32. .zt div:first-of-type{
  33. top: 0;
  34. left: 0;
  35. background-color: yellowgreen;
  36. }
  37. .box .zt main {
  38. width: 320px;
  39. height: 200px;
  40. position: absolute;
  41. left: 41px;
  42. right: 41px;
  43. }
  44. .zt div:last-of-type{
  45. top: 0;
  46. right: 0;
  47. background-color: cadetblue;
  48. }
  49. footer{
  50. width: 400px;
  51. text-align: center;
  52. background-color: fuchsia;
  53. }
  54. </style>
  55. </head>
  56. <body>
  57. <div class="box">
  58. <header>头部</header>
  59. <div class="zt">
  60. <div>左边</div>
  61. <main>主体主体主体主体</main>
  62. <div>右边</div>
  63. </div>
  64. <footer>底部</footer>
  65. </div>
  66. </body>
  67. </html>
声明:本文内容转载自脚本之家,由网友自发贡献,版权归原作者所有,如您发现涉嫌抄袭侵权,请联系admin@php.cn 核实处理。
全部评论
文明上网理性发言,请遵守新闻评论服务协议