Blogger Information
Blog 26
fans 1
comment 1
visits 19729
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
《Flex实战案例》2019-12-26作业笔记
杨凡的博客
Original
696 people have browsed it

@import当前的CSS引用的其他的CSS样式,用在CSS文档中

二手商品列表组件代码

CSS代码

  1. /*导入元素公共初始化样式表*/
  2. @import "../../public_reset.css";
  3. @import "../../public/public_headline/public_headline.css";
  4. .public-second-hand {
  5. width: 1200px;
  6. padding: 10px;
  7. box-sizing: border-box;
  8. margin: auto;
  9. border-radius: 5px;
  10. background-color: #fff;
  11. }
  12. .public-second-hand:hover {
  13. box-shadow: 0 0 8px #888;
  14. }
  15. /*标题1*/
  16. .public-second-hand > .title1 {
  17. height: 50px;
  18. border-bottom: 1px solid #cccccc;
  19. }
  20. .public-second-hand > .title1 > a {
  21. font-size: 23px;
  22. margin-right: 20px;
  23. }
  24. .public-second-hand > .title1 > span {
  25. color: red;
  26. }
  27. /*标题2*/
  28. .public-second-hand > .title2 {
  29. height: 55px;
  30. }
  31. .public-second-hand > .title2 > span {
  32. color: red;
  33. font-size: 23px;
  34. }
  35. .public-second-hand > .title2 > span ~ a {
  36. padding-left: 20px;
  37. }
  38. .public-second-hand > .title2 > span ~ a:hover{
  39. color: lightcoral;
  40. }
  41. /*商品展示区*/
  42. .public-second-hand > .goods {
  43. height: 440px;
  44. display: flex;
  45. flex-flow: row nowrap;
  46. }
  47. .public-second-hand > .goods > .goods-list {
  48. padding: 10px;
  49. flex-basis: 800px;
  50. display: flex;
  51. flex-flow:row wrap;
  52. justify-content: space-between;
  53. }
  54. .public-second-hand > .goods > .goods-list img {
  55. width: 176px;
  56. height: 120px;
  57. }
  58. .public-second-hand > .goods > .goods-list > .intro {
  59. width: 178px;
  60. height: 200px;
  61. display: flex;
  62. flex-flow: column nowrap;
  63. }
  64. .public-second-hand > .goods > .goods-list > .intro img {
  65. border: 1px solid #cccccc;
  66. border-radius: 5px;
  67. }
  68. .public-second-hand > .goods > .goods-list > .intro span:first-of-type {
  69. color: red;
  70. }
  71. .public-second-hand > .goods > .goods-list > .intro > div {
  72. display: flex;
  73. }
  74. .public-second-hand > .goods > .goods-list > .intro span:last-of-type {
  75. color: white;
  76. background-color: #55ce9f;
  77. padding: 0 5px;
  78. margin-left: auto;
  79. }
  80. /*快速入口*/
  81. .public-second-hand > .goods > .quick-entry {
  82. flex-basis: 400px;
  83. padding: 10px;
  84. display: flex;
  85. flex-flow: row wrap;
  86. justify-content: space-between;
  87. }
  88. .public-second-hand > .goods > .quick-entry img {
  89. width: 190px;
  90. height: 130px;
  91. }
  92. .public-second-hand > .goods > .quick-entry > div {
  93. width: 400px;
  94. display: flex;
  95. flex-direction: column;
  96. }
  97. .public-second-hand > .goods > .quick-entry > div img {
  98. width: 393px;
  99. height: 60px;
  100. }

HTML代码

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <link rel="stylesheet" href="public_second_hand.css">
  6. <title>公共二手交易区组件</title>
  7. </head>
  8. <body>
  9. <!--引入大标题组件-->
  10. <div class="public-headline">
  11. <span>二手交易</span>
  12. </div>
  13. <!--二手交易专区-->
  14. <div class="public-second-hand">
  15. <!--标题1-->
  16. <div class="title1">
  17. <a href="">抢好货</a>
  18. <span>0低价,便捷,安全,快速</span>
  19. </div>
  20. <!--标题2-->
  21. <div class="title2">
  22. <span>热门分类</span>
  23. <a href="">美女写真</a>
  24. <a href="">日本美女</a>
  25. <a href="">美国美女</a>
  26. <a href="">国内美女</a>
  27. <a href="">AV美女</a>
  28. </div>
  29. <!--商品展示区-->
  30. <div class="goods">
  31. <!--1.左边商品列表-->
  32. <div class="goods-list">
  33. <!--商品简介-->
  34. <div class="intro">
  35. <a href="" ><img src="../../../static/images/shop/shop1.jpg" alt=""></a>
  36. <a href="">美女性感写真海报墙艺术装饰画贴画图1</a>
  37. <div>
  38. <span>¥333</span>
  39. <span>美女</span>
  40. </div>
  41. </div>
  42. <div class="intro">
  43. <a href="" ><img src="../../../static/images/shop/shop2.jpg" alt=""></a>
  44. <a href="">美女性感写真海报墙艺术装饰画贴画图2</a>
  45. <div>
  46. <span>¥333</span>
  47. <span>美女</span>
  48. </div>
  49. </div>
  50. <div class="intro">
  51. <a href="" ><img src="../../../static/images/shop/shop3.jpg" alt=""></a>
  52. <a href="">美女性感写真海报墙艺术装饰画贴画图3</a>
  53. <div>
  54. <span>¥333</span>
  55. <span>美女</span>
  56. </div>
  57. </div>
  58. <div class="intro">
  59. <a href="" ><img src="../../../static/images/shop/shop4.jpg" alt=""></a>
  60. <a href="">美女性感写真海报墙艺术装饰画贴画图4</a>
  61. <div>
  62. <span>¥333</span>
  63. <span>美女</span>
  64. </div>
  65. </div>
  66. <div class="intro">
  67. <a href="" ><img src="../../../static/images/shop/shop5.jpg" alt=""></a>
  68. <a href="">美女性感写真海报墙艺术装饰画贴画图5</a>
  69. <div>
  70. <span>¥333</span>
  71. <span>美女</span>
  72. </div>
  73. </div>
  74. <div class="intro">
  75. <a href="" ><img src="../../../static/images/shop/shop6.jpg" alt=""></a>
  76. <a href="">美女性感写真海报墙艺术装饰画贴画图6</a>
  77. <div>
  78. <span>¥333</span>
  79. <span>美女</span>
  80. </div>
  81. </div>
  82. <div class="intro">
  83. <a href="" ><img src="../../../static/images/shop/shop7.jpg" alt=""></a>
  84. <a href="">美女性感写真海报墙艺术装饰画贴画图7</a>
  85. <div>
  86. <span>¥333</span>
  87. <span>美女</span>
  88. </div>
  89. </div>
  90. <div class="intro">
  91. <a href="" ><img src="../../../static/images/shop/shop8.jpg" alt=""></a>
  92. <a href="">美女性感写真海报墙艺术装饰画贴画图8</a>
  93. <div>
  94. <span>¥333</span>
  95. <span>美女</span>
  96. </div>
  97. </div>
  98. </div>
  99. <!--2.右侧的功能快捷入口-->
  100. <div class="quick-entry">
  101. <a href=""><img src="../../../static/images/ad/1.png" alt=""></a>
  102. <a href=""><img src="../../../static/images/ad/2.png" alt=""></a>
  103. <a href=""><img src="../../../static/images/ad/3.png" alt=""></a>
  104. <a href=""><img src="../../../static/images/ad/4.png" alt=""></a>
  105. <div>
  106. <a href=""><img src="../../../static/images/ad/image.png" alt=""></a>
  107. <a href=""><img src="../../../static/images/ad/ad2.jpg" alt=""></a>
  108. </div>
  109. </div>
  110. </div>
  111. </div>
  112. </body>
  113. </html>

分页条组件代码

CSS代码

  1. /*导入元素公共初始化样式表*/
  2. @import "../../public_reset.css";
  3. .public-paginate {
  4. margin: 20px auto;
  5. display: flex;
  6. justify-content: center;
  7. }
  8. /*设置每一个分页码的样式*/
  9. .public-paginate > a {
  10. margin-right: 5px;
  11. font-size: 16px;
  12. padding: 5px 20px;
  13. background-color: #fff;
  14. border-radius: 3px;
  15. }
  16. .public-paginate > a:hover {
  17. background-color: #44aaee;
  18. color: white;
  19. box-shadow:0 0 3px #888888;
  20. }

HTML代码

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <link rel="stylesheet" href="public_paginate.css">
  6. <title>公共分页条组件</title>
  7. </head>
  8. <body>
  9. <div class="public-paginate">
  10. <a href=""><</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="">></a>
  20. </div>
  21. </body>
  22. </html>

评论与回复组件

CSS代码

  1. /*导入元素公共初始化样式表*/
  2. @import "../../public_reset.css";
  3. .public-comment-reply {
  4. padding: 15px;
  5. box-sizing: border-box;
  6. background-color: #fff;
  7. display: flex;
  8. flex-direction: column;
  9. }
  10. .public-comment-reply img {
  11. width: 60px;
  12. height: 60px;
  13. border-radius: 5px;
  14. box-shadow: 1px 1px 3px #cccccc;
  15. }
  16. .public-comment-reply > .comment {
  17. display: flex;
  18. flex-direction: column;
  19. }
  20. .public-comment-reply > .comment h3 {
  21. padding: 20px 0;
  22. border-top: 1px solid #cccccc;
  23. }
  24. .public-comment-reply > .comment > div {
  25. padding: 15px;
  26. height: 200px;
  27. display: flex;
  28. flex-flow: row nowrap;
  29. }
  30. .public-comment-reply > .comment >div img {
  31. align-self: flex-start;
  32. }
  33. .public-comment-reply > .comment >div textarea {
  34. height: 200px;
  35. margin-left: 20px;
  36. resize: none;
  37. flex: auto;
  38. }
  39. .public-comment-reply > .comment >div textarea:hover {
  40. box-shadow: 0 0 8px #888888;
  41. }
  42. .public-comment-reply > .comment > button {
  43. font-size: 14px;
  44. background-color: #f64c59;
  45. border: none;
  46. color: white;
  47. width: 150px;
  48. height: 40px;
  49. align-self: flex-end;
  50. }
  51. .public-comment-reply > .comment > button:hover {
  52. background-color: #178cee;
  53. box-shadow: 0 0 8px #888888;
  54. cursor: pointer;
  55. }
  56. /*回复区*/
  57. .public-comment-reply > .reply {
  58. display: flex;
  59. flex-direction: column;
  60. padding: 15px 0;
  61. }
  62. .public-comment-reply > .reply > h3 {
  63. padding: 20px 0;
  64. }
  65. .public-comment-reply > .reply > div {
  66. display: flex;
  67. margin-top: 30px;
  68. }
  69. .public-comment-reply > .reply > div > img {
  70. align-self: center;
  71. }
  72. .public-comment-reply > .reply > div > .detail {
  73. flex: auto;
  74. display: flex;
  75. flex-direction: column;
  76. margin-left: 20px;
  77. height:90px;
  78. justify-content: space-between;
  79. }
  80. .public-comment-reply > .reply > div > .detail > div {
  81. display: flex;
  82. justify-content: space-between;
  83. }
  84. .public-comment-reply > .reply > div > .detail > div i {
  85. color: red;
  86. font-size: 1.2rem;
  87. margin-right: 5px;
  88. }

HTML代码

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <link rel="stylesheet" href="../../../static/font/iconfont.css">
  6. <link rel="stylesheet" href="public_comment_reply.css">
  7. <title>评论与回复组件</title>
  8. </head>
  9. <body>
  10. <div class="public-comment-reply">
  11. <!--评论区-->
  12. <div class="comment">
  13. <h3>我要评论</h3>
  14. <div>
  15. <label for="comment">
  16. <img src="../../../static/images/皮特朱.png" alt="">
  17. </label>
  18. <textarea name="" id="comment"></textarea>
  19. </div>
  20. <button>发表评论</button>
  21. </div>
  22. <!--回复区-->
  23. <div class="reply">
  24. <h3>最新回复</h3>
  25. <div>
  26. <img src="../../../static/images/皮特朱.png" alt="">
  27. <div class="detail">
  28. <span>Peter-Zhu</span>
  29. <span>留言内容:PHP中文网是一个有深度,有思想的学习平台</span>
  30. <div>
  31. <span>2020-01-02 16:46:22发表</span>
  32. <span><i class="iconfont icon-dianzan"></i>回复</span>
  33. </div>
  34. </div>
  35. </div>
  36. <div>
  37. <img src="../../../static/images/皮特朱.png" alt="">
  38. <div class="detail">
  39. <span>Peter-Zhu</span>
  40. <span>留言内容:PHP中文网是一个有深度,有思想的学习平台</span>
  41. <div>
  42. <span>2020-01-02 16:46:22发表</span>
  43. <span><i class="iconfont icon-dianzan"></i>回复</span>
  44. </div>
  45. </div>
  46. </div>
  47. <div>
  48. <img src="../../../static/images/皮特朱.png" alt="">
  49. <div class="detail">
  50. <span>Peter-Zhu</span>
  51. <span>留言内容:PHP中文网是一个有深度,有思想的学习平台</span>
  52. <div>
  53. <span>2020-01-02 16:46:22发表</span>
  54. <span><i class="iconfont icon-dianzan"></i>回复</span>
  55. </div>
  56. </div>
  57. </div>
  58. <div>
  59. <img src="../../../static/images/皮特朱.png" alt="">
  60. <div class="detail">
  61. <span>Peter-Zhu</span>
  62. <span>留言内容:PHP中文网是一个有深度,有思想的学习平台</span>
  63. <div>
  64. <span>2020-01-02 16:46:22发表</span>
  65. <span><i class="iconfont icon-dianzan"></i>回复</span>
  66. </div>
  67. </div>
  68. </div>
  69. </div>
  70. </div>
  71. </body>
  72. </html>

Correcting teacher:天蓬老师天蓬老师

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