博客列表 >flex实战(二手交易区,翻页,评论组件)

flex实战(二手交易区,翻页,评论组件)

xiaosheng
xiaosheng原创
2019年12月27日 19:38:46695浏览

flex布局实战


二手交易区组件

_second_hand.html

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>二手交易区</title>
  6. <link rel="stylesheet" href="../../../static/css/_second_hand.css">
  7. </head>
  8. <body>
  9. <div class="title">
  10. <span>二手交易</span>
  11. </div>
  12. <div class="content">
  13. <div class="content-title">
  14. <span>抢好货</span>
  15. <span>0低价.便捷.安全.快速</span>
  16. </div>
  17. <div class="sort">
  18. <span>热门分类</span>
  19. <ul>
  20. <li><a href="">美女写真</a></li>
  21. <li><a href="">日本美女</a></li>
  22. <li><a href="">美国美女</a></li>
  23. <li><a href="">国内美女</a></li>
  24. <li><a href="">AV美女</a></li>
  25. </ul>
  26. </div>
  27. <div class="goods">
  28. <div class="good">
  29. <a class="good-img" href="">
  30. <img src="../../../static/images/shop/shop3.jpg" alt="">
  31. </a>
  32. <p class="introduce">美女性感写真海报墙艺术装饰画贴画涂1</p>
  33. <div>
  34. <span class="price">$333</span>
  35. <span class="tag">美女</span>
  36. </div>
  37. </div>
  38. <div class="good">
  39. <a class="good-img" href="">
  40. <img src="../../../static/images/shop/shop3.jpg" alt="">
  41. </a>
  42. <p class="introduce">美女性感写真海报墙艺术装饰画贴画涂1</p>
  43. <div>
  44. <span class="price">$333</span>
  45. <span class="tag">美女</span>
  46. </div>
  47. </div>
  48. <div class="good">
  49. <a class="good-img" href="">
  50. <img src="../../../static/images/shop/shop3.jpg" alt="">
  51. </a>
  52. <p class="introduce">美女性感写真海报墙艺术装饰画贴画涂1</p>
  53. <div>
  54. <span class="price">$333</span>
  55. <span class="tag">美女</span>
  56. </div>
  57. </div>
  58. <div class="good">
  59. <a class="good-img" href="">
  60. <img src="../../../static/images/shop/shop3.jpg" alt="">
  61. </a>
  62. <p class="introduce">美女性感写真海报墙艺术装饰画贴画涂1</p>
  63. <div>
  64. <span class="price">$333</span>
  65. <span class="tag">美女</span>
  66. </div>
  67. </div>
  68. <div class="good">
  69. <a class="good-img" href="">
  70. <img src="../../../static/images/shop/shop3.jpg" alt="">
  71. </a>
  72. <p class="introduce">美女性感写真海报墙艺术装饰画贴画涂1</p>
  73. <div>
  74. <span class="price">$333</span>
  75. <span class="tag">美女</span>
  76. </div>
  77. </div>
  78. <div class="good">
  79. <a class="good-img" href="">
  80. <img src="../../../static/images/shop/shop3.jpg" alt="">
  81. </a>
  82. <p class="introduce">美女性感写真海报墙艺术装饰画贴画涂1</p>
  83. <div>
  84. <span class="price">$333</span>
  85. <span class="tag">美女</span>
  86. </div>
  87. </div>
  88. <div class="good">
  89. <a class="good-img" href="">
  90. <img src="../../../static/images/shop/shop3.jpg" alt="">
  91. </a>
  92. <p class="introduce">美女性感写真海报墙艺术装饰画贴画涂1</p>
  93. <div>
  94. <span class="price">$333</span>
  95. <span class="tag">美女</span>
  96. </div>
  97. </div>
  98. <div class="good">
  99. <a class="good-img" href="">
  100. <img src="../../../static/images/shop/shop3.jpg" alt="">
  101. </a>
  102. <p class="introduce">美女性感写真海报墙艺术装饰画贴画涂1</p>
  103. <div>
  104. <span class="price">$333</span>
  105. <span class="tag">美女</span>
  106. </div>
  107. </div>
  108. </div>
  109. <div class="ad">
  110. <div class="ad-4">
  111. <a href=""><img src="../../../static/images/ad/1.png" alt=""></a>
  112. <a href=""><img src="../../../static/images/ad/2.png" alt=""></a>
  113. <a href=""><img src="../../../static/images/ad/3.png" alt=""></a>
  114. <a href=""><img src="../../../static/images/ad/4.png" alt=""></a>
  115. </div>
  116. <a href="">
  117. <img src="../../../static/images/ad/image.png" alt="">
  118. </a>
  119. <a href="">
  120. <img src="../../../static/images/ad/ad2.jpg" alt="">
  121. </a>
  122. </div>
  123. </div>
  124. </body>
  125. </html>

_second_hand.css

  1. @import "reset.css";
  2. @import "_title.css";
  3. body {
  4. background-color: #cccccc;
  5. }
  6. li {
  7. list-style-type: none;
  8. }
  9. .content {
  10. width: 1200px;
  11. background-color: #fff;
  12. margin: 20px auto 0;
  13. padding: 5px 10px 5px 10px;
  14. position: relative;
  15. -webkit-box-sizing: border-box;
  16. -moz-box-sizing: border-box;
  17. box-sizing: border-box;
  18. }
  19. .content:hover {
  20. box-shadow:0px 0px 10px #000;
  21. }
  22. .content .content-title {
  23. height: 40px;
  24. border-bottom: 1px solid #cccccc;
  25. }
  26. .content .content-title span:first-child {
  27. font-size: 20px;
  28. color: RGB(97, 105, 129);
  29. }
  30. .content .content-title span:nth-child(2) {
  31. color: red;
  32. margin-left: 20px;
  33. }
  34. .content > .sort {
  35. height: 30px;
  36. position: relative;
  37. }
  38. .content > .sort > span {
  39. font-size: 20px;
  40. color: red;
  41. }
  42. .content > .sort > ul {
  43. width: 400px;
  44. height: 25px;
  45. position: absolute;
  46. top: 0;
  47. left: 105px;
  48. display: flex;
  49. justify-content: space-between;
  50. align-items: flex-end;
  51. }
  52. .content > .sort > ul > li > a {
  53. color: RGB(135, 136, 139);
  54. }
  55. .content > .sort > ul > li > a:hover {
  56. color: red;
  57. }
  58. .content .goods {
  59. width: 720px;
  60. margin-left: 5px;
  61. display: flex;
  62. flex-wrap: wrap;
  63. margin-top: 25px;
  64. justify-content: space-between;
  65. }
  66. .content .goods .good {
  67. width: 170px;
  68. height: 220px;
  69. }
  70. .content .goods .good .good-img {
  71. width: 170px;
  72. height: 120px;
  73. }
  74. .content .goods .good .good-img > img {
  75. width: 170px;
  76. height: 120px;
  77. -webkit-border-radius: 5px;
  78. -moz-border-radius: 5px;
  79. border-radius: 5px;
  80. }
  81. .content .goods .good .good-img > img:hover {
  82. box-shadow:0px 0px 10px #000;
  83. }
  84. .content .goods .good .introduce {
  85. width: 170px;
  86. margin-top: 5px;
  87. color: RGB(139, 139, 132);
  88. }
  89. .content .goods .good > div {
  90. margin-top: 5px;
  91. }
  92. .content .goods .good > div > .price {
  93. color: #df5000;
  94. }
  95. .content .goods .good > div > .tag {
  96. display: inline-block;
  97. width: 27px;
  98. height: 18px;
  99. text-align: center;
  100. line-height: 18px;
  101. background-color: RGB(136, 201, 170);
  102. margin-left: 110px;
  103. -webkit-border-radius: 3px;
  104. -moz-border-radius: 3px;
  105. border-radius: 3px;
  106. }
  107. .content .ad {
  108. width: 420px;
  109. position: absolute;
  110. top: 100px;
  111. right: 20px;
  112. }
  113. .content .ad .ad-4 {
  114. height: 280px;
  115. display: flex;
  116. flex-wrap: wrap;
  117. justify-content: space-between;
  118. }
  119. .content .ad > .ad-4 img {
  120. width: 200px;
  121. height: 130px;
  122. }
  123. .content .ad > .ad-4 img:hover {
  124. box-shadow:0px 0px 10px #000;
  125. }


翻页组件

_paginate.html

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>分页</title>
  6. <link rel="stylesheet" href="../../../static/css/_paginate.css">
  7. </head>
  8. <body>
  9. <div class="paginate">
  10. <a href="">&lt;</a>
  11. <a href="">1</a>
  12. <a href="">2</a>
  13. <a href="">3</a>
  14. <a href="">4</a>
  15. <a href="">5</a>
  16. <a href="">6</a>
  17. <a href="">7</a>
  18. <a href="">8</a>
  19. <a href="">9</a>
  20. <a href="">&gt;</a>
  21. </div>
  22. </body>
  23. </html>

_paginate.css

  1. @import "reset.css";
  2. .paginate {
  3. width: 400px;
  4. margin: 20px auto;
  5. display: flex;
  6. justify-content: space-between;
  7. }
  8. .paginate > a {
  9. width: 30px;
  10. height: 30px;
  11. border: 1px solid #abcdef;
  12. text-align: center;
  13. line-height: 30px;
  14. }
  15. .paginate > a:hover {
  16. background-color: #abcdef;
  17. color: #ffffff;
  18. }


回复和评论组件

_comment.html

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>评论和回复</title>
  6. <link rel="stylesheet" href="../../../static/css/_comment.css">
  7. <link rel="stylesheet" href="../../../static/font/iconfont.css">
  8. </head>
  9. <body>
  10. <div class="comment-contents">
  11. <p>我要评论</p>
  12. <div class="create-comment">
  13. <a class="create-head" href="">
  14. <img class="user-head" src="../../../static/images/user.png" alt="">
  15. </a>
  16. <form action="">
  17. <textarea name="" id="" cols="150" rows="20"></textarea>
  18. <br>
  19. <button class="submit" type="submit">发表评论</button>
  20. </form>
  21. </div>
  22. <p>最新回复</p>
  23. <div class="all-comments">
  24. <div class="comment">
  25. <a class="comment-user-head" href="">
  26. <img class="user-head" src="../../../static/images/user.png" alt="">
  27. </a>
  28. <span class="comment-user-name">用户昵称</span>
  29. <span class="comment-content">留言内容:PHP是世界上最好的语言</span>
  30. <span class="comment-time">2019-12-27 18:05 发表</span>
  31. <span class="replay">
  32. <i class="iconfont icon-dianzan"></i> 回复
  33. </span>
  34. </div>
  35. <div class="comment">
  36. <a class="comment-user-head" href="">
  37. <img class="user-head" src="../../../static/images/user.png" alt="">
  38. </a>
  39. <span class="comment-user-name">用户昵称</span>
  40. <span class="comment-content">留言内容:PHP是世界上最好的语言</span>
  41. <span class="comment-time">2019-12-27 18:05 发表</span>
  42. <span class="replay">
  43. <i class="iconfont icon-dianzan"></i> 回复
  44. </span>
  45. </div>
  46. <div class="comment">
  47. <a class="comment-user-head" href="">
  48. <img class="user-head" src="../../../static/images/user.png" alt="">
  49. </a>
  50. <span class="comment-user-name">用户昵称</span>
  51. <span class="comment-content">留言内容:PHP是世界上最好的语言</span>
  52. <span class="comment-time">2019-12-27 18:05 发表</span>
  53. <span class="replay">
  54. <i class="iconfont icon-dianzan"></i> 回复
  55. </span>
  56. </div>
  57. </div>
  58. </div>
  59. </body>
  60. </html>

_comment.css

  1. @import "reset.css";
  2. .comment-contents {
  3. width: 1200px;
  4. border-top: 1px solid #cccccc;
  5. margin: 15px auto 0;
  6. }
  7. .comment-contents > p {
  8. margin-top: 20px;
  9. color: RGB(108, 111, 118);
  10. font-weight: 700;
  11. }
  12. .comment-contents > .create-comment {
  13. height: 350px;
  14. margin: 30px 0 0 10px;
  15. position: relative;
  16. }
  17. .comment-contents > .create-comment > .create-head {
  18. display: inline-block;
  19. width: 70px;
  20. height: 70px;
  21. }
  22. .user-head {
  23. width: 70px;
  24. height: 70px;
  25. -webkit-border-radius: 5px;
  26. -moz-border-radius: 5px;
  27. border-radius: 5px;
  28. }
  29. .comment-contents > .create-comment > form {
  30. position: absolute;
  31. top: 0;
  32. left: 80px;
  33. }
  34. .comment-contents > .create-comment > form > .submit {
  35. width: 100px;
  36. height: 40px;
  37. -webkit-border-radius: 5px;
  38. -moz-border-radius: 5px;
  39. border-radius: 5px;
  40. position:absolute;
  41. right: 0;
  42. background-color: RGB(225, 102, 104);
  43. }
  44. .comment-contents > .all-comments {
  45. margin-top: 50px;
  46. }
  47. .comment-contents > .all-comments > .comment {
  48. position: relative;
  49. height: 130px;
  50. }
  51. .comment-contents > .all-comments > .comment > .comment-user-head > img {
  52. margin-top: 10px;
  53. }
  54. .comment-contents > .all-comments > .comment > .comment-user-name {
  55. position: absolute;
  56. top: 0;
  57. left: 90px;
  58. }
  59. .comment-contents > .all-comments > .comment > .comment-content {
  60. position: absolute;
  61. top: 35px;
  62. left: 90px;
  63. }
  64. .comment-contents > .all-comments > .comment > .comment-time {
  65. position: absolute;
  66. top: 70px;
  67. left: 90px;
  68. }
  69. .comment-contents > .all-comments > .comment > .replay {
  70. position: absolute;
  71. top: 70px;
  72. right: 200px;
  73. }
  74. .comment-contents > .all-comments > .comment > .replay > i {
  75. color: red;
  76. }

声明:本文内容转载自脚本之家,由网友自发贡献,版权归原作者所有,如您发现涉嫌抄袭侵权,请联系admin@php.cn 核实处理。
全部评论
文明上网理性发言,请遵守新闻评论服务协议