Blogger Information
Blog 13
fans 0
comment 0
visits 10313
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
1226-二手商品列表与评论与回复
Original
642 people have browsed it

二手商品列表

HTML

  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  7. <link rel="stylesheet" href="public-headline-demo.css">
  8. <title>标题组件</title>
  9. </head>
  10. <body>
  11. <div class="public-headline">
  12. <span>素材交易</span>
  13. </div>
  14. <!-- 标题组件 -->
  15. <div class="public-headline-demo">
  16. <!-- 标题 -->
  17. <div class="title1">
  18. <a href="">图库</a>
  19. <span>便宜 方便 安全</span>
  20. </div>
  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="">风景</a>
  28. <a href="">插画</a>
  29. <a href="">手绘</a>
  30. <a href="">名画</a>
  31. </div>
  32. <div class="pic">
  33. <!-- 左侧 -->
  34. <div class="pic-list">
  35. <!-- 图片预览 -->
  36. <div class="intro">
  37. <a href=""><img src="../../../static/images/11.jpg" alt="" width="180px" height="150px"></a>
  38. <a href="">明星</a>
  39. <div>
  40. <span>&yen;998</span>
  41. <span>明星</span>
  42. </div>
  43. </div>
  44. <div class="intro">
  45. <a href=""><img src="../../../static/images/11.jpg" alt="" width="180px" height="150px"></a>
  46. <a href="">动图</a>
  47. <div>
  48. <span>&yen;998</span>
  49. <span>动图</span>
  50. </div>
  51. </div>
  52. <div class="intro">
  53. <a href=""><img src="../../../static/images/11.jpg" alt="" width="180px" height="150px"></a>
  54. <a href="">搞笑</a>
  55. <div>
  56. <span>&yen;998</span>
  57. <span>搞笑</span>
  58. </div>
  59. </div>
  60. <div class="intro">
  61. <a href=""><img src="../../../static/images/11.jpg" alt="" width="180px" height="150px"></a>
  62. <a href="">表情包</a>
  63. <div>
  64. <span>&yen;998</span>
  65. <span>表情包</span>
  66. </div>
  67. </div>
  68. <div class="intro">
  69. <a href=""><img src="../../../static/images/11.jpg" alt="" width="180px" height="150px"></a>
  70. <a href="">风景</a>
  71. <div>
  72. <span>&yen;998</span>
  73. <span>风景</span>
  74. </div>
  75. </div>
  76. <div class="intro">
  77. <a href=""><img src="../../../static/images/11.jpg" alt="" width="180px" height="150px"></a>
  78. <a href="">插画</a>
  79. <div>
  80. <span>&yen;998</span>
  81. <span>插画</span>
  82. </div>
  83. </div>
  84. <div class="intro">
  85. <a href=""><img src="../../../static/images/11.jpg" alt="" width="180px" height="150px"></a>
  86. <a href="">手绘</a>
  87. <div>
  88. <span>&yen;998</span>
  89. <span>手绘</span>
  90. </div>
  91. </div>
  92. <div class="intro">
  93. <a href=""><img src="../../../static/images/11.jpg" alt="" width="180px" height="150px"></a>
  94. <a href="">名画</a>
  95. <div>
  96. <span>&yen;998</span>
  97. <span>名画</span>
  98. </div>
  99. </div>
  100. </div>
  101. <!-- 右侧 -->
  102. <div class="ad-list">
  103. <a href=""><img src="../../../static/images/ad/1.png" alt=""></a>
  104. <a href=""><img src="../../../static/images/ad/2.png" alt=""></a>
  105. <a href=""><img src="../../../static/images/ad/3.png" alt=""></a>
  106. <a href=""><img src="../../../static/images/ad/4.png" alt=""></a>
  107. <div>
  108. <a href=""><img src="../../../static/images/ad/image.png" alt=""></a>
  109. <a href=""><img src="../../../static/images/ad/ad2.jpg" alt=""></a>
  110. </div>
  111. </div>
  112. </div>
  113. </div>
  114. </body>
  115. </html>

CSS

  1. /* 通用样式 */
  2. @import "../public-reset.css";
  3. /* 大标题样式 */
  4. @import "../public-headline/public-headline.css";
  5. .public-headline-demo{
  6. width: 1200px;
  7. padding: 10px;
  8. box-sizing: border-box;
  9. margin: auto;
  10. border-radius: 5px;
  11. border-color: #fff;
  12. }
  13. .public-headline-demo:hover{
  14. box-shadow: 0 0 5px #888;
  15. }
  16. /* 图库 */
  17. .public-headline-demo > .title1{
  18. height: 50px;
  19. border-bottom: 1px solid #ccc;
  20. box-sizing: border-box;
  21. }
  22. .public-headline-demo > .title1 >a{
  23. font-size: 23px;
  24. margin-right: 20px;
  25. }
  26. .public-headline-demo>.title1>span{
  27. color: red;
  28. }
  29. /* 热门图库 */
  30. .public-headline-demo > .title2{
  31. height: 55px;
  32. border-bottom: 1px solid #cdcdcd;
  33. line-height: 55px;
  34. }
  35. .public-headline-demo>.title2>span{
  36. color: red;
  37. font-size: 23px;
  38. }
  39. .public-headline-demo>.title2>span ~a{
  40. padding-left: 20px;
  41. }
  42. .public-headline-demo>.title2>span ~a:hover{
  43. color: royalblue;
  44. }
  45. /* 图片展示区 */
  46. .public-headline-demo>.pic{
  47. height: 440px;
  48. display: flex;
  49. }
  50. .public-headline-demo>.pic>.pic-list{
  51. padding: 10px;
  52. flex-basis: 800px;
  53. display: flex;
  54. flex-flow: row wrap;
  55. justify-content: space-between;
  56. }
  57. .public-headline-demo>.pic>.pic-list>.intro{
  58. width: 178px;
  59. height: 200px;
  60. display: flex;
  61. flex-flow: column nowrap;
  62. justify-content: space-between;
  63. }
  64. .public-headline-demo>.pic>.pic-list>.intro img{
  65. border: 1px solid #ccc;
  66. border-radius: 5px;
  67. }
  68. .public-headline-demo>.pic>.pic-list>.intro span:first-of-type{
  69. color: red;
  70. }
  71. .public-headline-demo>.pic>.pic-list>.intro >div{
  72. display: flex;
  73. }
  74. .public-headline-demo>.pic>.pic-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-headline-demo > .pic > .ad-list {
  82. flex-basis: 400px;
  83. padding: 10px;
  84. display: flex;
  85. flex-flow: row wrap;
  86. justify-content: space-between;
  87. }
  88. .public-headline-demo > .pic > .ad-list img {
  89. width: 190px;
  90. height: 130px;
  91. }
  92. .public-headline-demo > .pic > .ad-list > div {
  93. width: 400px;
  94. display: flex;
  95. flex-direction: column;
  96. }
  97. .public-headline-demo > .pic > .ad-list > div img {
  98. width: 393px;
  99. height: 60px;
  100. }

效果图

在这里分享一个坑,原本我右边在谷歌浏览器是不显示图片的(如下图),Edge浏览器就可以,就觉得很神奇,研究发现右边图片放别的路径的就显示,放广告图片就不显示,左边同样不显示广告图片,谷歌浏览器也报错无法加载图片,最后发现是谷歌浏览器的广告拦截插件把ad文件夹的内容直接屏蔽掉了,关闭插件就出现了


评论与回复

HTML

  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  7. <link rel="stylesheet" href="../../../static/font/iconfont.css">
  8. <link rel="stylesheet" href="public-message.css">
  9. <title>评论回复</title>
  10. </head>
  11. <body>
  12. <div class="public-message">
  13. <!-- 评论 -->
  14. <div class="comment">
  15. <h4>我要评论</h4>
  16. <div>
  17. <label for="comment">
  18. <img src="../../../static/images/user.png" alt="">
  19. </label>
  20. <textarea name="" id="comment">
  21. </textarea>
  22. </div>
  23. <button>发表评论</button>
  24. </div>
  25. <!-- 回复 -->
  26. <div class="reply">
  27. <h3>最新回复</h3>
  28. <div>
  29. <img src="../../../static/images/user.png" alt="">
  30. <div class="detail">
  31. <span>昵称:<span>admin1</span></span>
  32. <span>留言: 这是一条留言内容</span>
  33. <div>
  34. <span>发布于:2019-12-30</span>
  35. <span><i class="iconfont icon-dianzan"></i>回复</span>
  36. </div>
  37. </div>
  38. </div>
  39. <div>
  40. <img src="../../../static/images/user.png" alt="">
  41. <div class="detail">
  42. <span>昵称:路人甲</span>
  43. <span>留言:这是一条留言内容</span>
  44. <div>
  45. <span>发表于:2019-12-30</span>
  46. <span><i class="iconfont icon-dianzan"></i>回复</span>
  47. </div>
  48. </div>
  49. </div>
  50. </div>
  51. </div>
  52. </body>
  53. </html>

CSS

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

效果图

思路方法

对组件进行区块的划分
考虑区块中项目的排列方式以及对齐方式
逐步细化元素的样式

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
Author's latest blog post