博客列表 >前端学习-1226号作业

前端学习-1226号作业

天
原创
2020年01月06日 17:13:46495浏览

效果图展示

布局思路:最主要的是先行分析整个布局方案,从上到下,从左到右,先html再一步步css,outline的帮助的巨大的,看得到才能写的到。代码是跟着录播一边思考一边写的,应该多多练习,熟能生巧

二手交易

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. <link rel="stylesheet" href="../public_headline/public_headline.css">
  7. <title>公共二手区域交易组件</title>
  8. </head>
  9. <body>
  10. <div class="public-headline">
  11. <!-- 文本必须/推荐放在一个行内标签中,div中的文本成为匿名文本-->
  12. <span>二手交易</span>
  13. </div>
  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="">AV美女</a>
  27. <a href="">美国美女</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="" width="176" height="120"></a>
  36. <a href="">美女性感写真</a>
  37. <div>
  38. <span>&yen; 333</span>
  39. <span>美女</span>
  40. </div>
  41. </div>
  42. <div class="intro">
  43. <a href="" ><img src="../../../static/images/shop/shop1.jpg" alt="" width="176" height="120"></a>
  44. <a href="">美女性感写真</a>
  45. <div>
  46. <span>&yen; 333</span>
  47. <span>美女</span>
  48. </div>
  49. </div>
  50. <div class="intro">
  51. <a href="" ><img src="../../../static/images/shop/shop1.jpg" alt="" width="176" height="120"></a>
  52. <a href="">美女性感写真</a>
  53. <div>
  54. <span>&yen; 333</span>
  55. <span>美女</span>
  56. </div>
  57. </div>
  58. <div class="intro">
  59. <a href="" ><img src="../../../static/images/shop/shop1.jpg" alt="" width="176" height="120"></a>
  60. <a href="">美女性感写真</a>
  61. <div>
  62. <span>&yen; 333</span>
  63. <span>美女</span>
  64. </div>
  65. </div>
  66. <div class="intro">
  67. <a href="" ><img src="../../../static/images/shop/shop1.jpg" alt="" width="176" height="120"></a>
  68. <a href="">美女性感写真</a>
  69. <div>
  70. <span>&yen; 333</span>
  71. <span>美女</span>
  72. </div>
  73. </div>
  74. <div class="intro">
  75. <a href="" ><img src="../../../static/images/shop/shop1.jpg" alt="" width="176" height="120"></a>
  76. <a href="">美女性感写真</a>
  77. <div>
  78. <span>&yen; 333</span>
  79. <span>美女</span>
  80. </div>
  81. </div>
  82. <div class="intro">
  83. <a href="" ><img src="../../../static/images/shop/shop1.jpg" alt="" width="176" height="120"></a>
  84. <a href="">美女性感写真</a>
  85. <div>
  86. <span>&yen; 333</span>
  87. <span>美女</span>
  88. </div>
  89. </div>
  90. <div class="intro">
  91. <a href="" ><img src="../../../static/images/shop/shop1.jpg" alt="" width="176" height="120"></a>
  92. <a href="">美女性感写真</a>
  93. <div>
  94. <span>&yen; 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. /*大标题组件*/
  4. @import "../public_headline/public_headline.css";
  5. /*二手交易专区的样式表*/
  6. .public_second_hand{
  7. width: 1200px;
  8. padding: 10px;
  9. box-sizing: border-box;
  10. margin: auto;
  11. border-radius: 5px;
  12. background-color: #fff;
  13. }
  14. .public_second_hand:hover{
  15. box-shadow: 0 0 8px #888;
  16. }
  17. /*标题一*/
  18. .title1 {
  19. height: 50px;
  20. border-bottom: 1px solid #cccccc;
  21. box-sizing: border-box;
  22. }
  23. .public_second_hand > .title1 > a {
  24. font-size: 23px;
  25. margin-right: 20px;
  26. }
  27. .public_second_hand > .title1 > span{
  28. color: red;
  29. }
  30. /*标题二*/
  31. .public_second_hand > .title2{
  32. height: 55px;
  33. }
  34. .public_second_hand > .title2 > span{
  35. font-size: 23px;
  36. margin-right: 20px;
  37. color: red;
  38. }
  39. .public_second_hand > .title2 > span ~ a{
  40. margin-left: 20px;
  41. }
  42. .public_second_hand > .title2 > span ~ a:hover{
  43. color: #795da3;
  44. }
  45. /*商品展示区*/
  46. .public_second_hand > .goods {
  47. height: 440px;
  48. display: flex;
  49. }
  50. .public_second_hand > .goods > .goods-list {
  51. padding: 10px;
  52. box-sizing: border-box;
  53. flex-basis: 800px;
  54. display: flex;
  55. flex-flow: row wrap;
  56. justify-content: space-between;
  57. }
  58. .public_second_hand > .goods > .goods-list > .intro {
  59. width: 178px;
  60. height: 200px;
  61. display: flex;
  62. flex-flow: column nowrap;
  63. justify-content: space-between;
  64. }
  65. .public_second_hand > .goods > .goods-list > .intro img {
  66. border-radius: 5px;
  67. border: 1px solid #cccccc;
  68. box-sizing: border-box;
  69. }
  70. .public_second_hand > .goods > .goods-list > .intro span:first-child {
  71. color: red;
  72. }
  73. .public_second_hand > .goods > .goods-list > .intro div {
  74. display: flex;
  75. justify-content: space-between;
  76. }
  77. .public_second_hand > .goods > .goods-list > .intro span:last-child {
  78. color: white;
  79. background-color: lightseagreen;
  80. padding:0 5px;
  81. margin-left: auto;
  82. }
  83. /*功能快速入口区*/
  84. .public_second_hand > .goods > .quick-entry {
  85. flex-basis: 400px;
  86. padding: 10px;
  87. display: flex;
  88. flex-flow: row wrap;
  89. justify-content: space-between;
  90. }
  91. .public_second_hand > .goods > .quick-entry img{
  92. width: 190px;
  93. height: 130px;
  94. }
  95. .public_second_hand > .goods > .quick-entry > div{
  96. width: 400px;
  97. display: flex;
  98. flex-flow: column nowrap;
  99. }
  100. .public_second_hand > .goods > .quick-entry > div img{
  101. width: 393px;
  102. height: 60px;
  103. display: flex;
  104. flex-flow: column nowrap;
  105. }

评论

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <link rel="stylesheet" href="public_comment_reply.css">
  6. <link rel="stylesheet" href="../../../static/font/iconfont.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/user.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/user.png" alt="">
  27. <div class="reply-detail">
  28. <span>用户昵称</span>
  29. <span>留言内容</span>
  30. <div class="dianzan">
  31. <span>时间</span>
  32. <span><i class="iconfont icon-dianzan"></i>回复</span>
  33. </div>
  34. </div>
  35. </div>
  36. <div>
  37. <img src="../../../static/images/user.png" alt="">
  38. <div class="reply-detail">
  39. <span>用户昵称</span>
  40. <span>留言内容</span>
  41. <div class="dianzan">
  42. <span>时间</span>
  43. <span><i class="iconfont icon-dianzan"></i>回复</span>
  44. </div>
  45. </div>
  46. </div>
  47. <div>
  48. <img src="../../../static/images/user.png" alt="">
  49. <div class="reply-detail">
  50. <span>用户昵称</span>
  51. <span>留言内容</span>
  52. <div class="dianzan">
  53. <span>时间</span>
  54. <span><i class="iconfont icon-dianzan"></i>回复</span>
  55. </div>
  56. </div>
  57. </div>
  58. <div>
  59. <img src="../../../static/images/user.png" alt="">
  60. <div class="reply-detail">
  61. <span>用户昵称</span>
  62. <span>留言内容</span>
  63. <div class="dianzan">
  64. <span>时间</span>
  65. <span><i class="iconfont icon-dianzan"></i>回复</span>
  66. </div>
  67. </div>
  68. </div>
  69. </div>
  70. </div>
  71. </body>
  72. </html>

CSS样式

  1. @import "../../public/public_reset.css";
  2. .public-comment-reply{
  3. padding: 15px;
  4. box-sizing: border-box;
  5. background-color: #fff;
  6. display: flex;
  7. flex-flow: column nowrap;
  8. }
  9. .public-comment-reply img{
  10. width: 60px;
  11. height: 60px;
  12. border-radius: 5px;
  13. box-shadow: 1px 1px 5px #cccccc;
  14. }
  15. .public-comment-reply > .comment{
  16. display: flex;
  17. flex-flow: column nowrap;
  18. }
  19. .public-comment-reply > .comment{
  20. display: flex;
  21. flex-flow: column nowrap;
  22. }
  23. .public-comment-reply .comment > h3{
  24. border-top: 1px solid #cccccc;
  25. padding: 20px 0;
  26. }
  27. .public-comment-reply .comment > div{
  28. padding: 15px 0;
  29. height: 200px;
  30. display: flex;
  31. flex-flow: row nowrap;
  32. }
  33. .public-comment-reply .comment > div img{
  34. align-self: start;
  35. }
  36. .public-comment-reply .comment > div textarea{
  37. height: 200px;
  38. margin-left: 20px;
  39. resize: none;/*使得文本域不会被拉伸*/
  40. flex: 1;
  41. }
  42. .public-comment-reply .comment > div textarea:hover{
  43. box-shadow: 0 0 5px #888888;
  44. }
  45. .public-comment-reply .comment >button{
  46. font-size: 14px;
  47. background-color: #f64c59;
  48. border: none;
  49. width: 150px;
  50. height: 40px;
  51. align-self: end;
  52. }
  53. .public-comment-reply .comment >button:hover {
  54. background-color: #178cee;
  55. box-shadow: 0 0 8px #888888;
  56. cursor: pointer;
  57. }
  58. /*回复区*/
  59. .public-comment-reply > .reply{
  60. display: flex;
  61. flex-flow: column nowrap;
  62. padding: 20px 0;
  63. }
  64. .public-comment-reply > .reply h3{
  65. font-size: 16px;
  66. padding: 20px 0;
  67. }
  68. .public-comment-reply > .reply > div{
  69. display: flex;
  70. flex-flow: row nowrap;
  71. margin-top: 20px;
  72. }
  73. .public-comment-reply > .reply > div img{
  74. align-self: center;
  75. }
  76. .public-comment-reply > .reply > .reply-detail{
  77. display: flex;
  78. flex-flow: column nowrap;
  79. }
  80. .public-comment-reply > .reply > div > .reply-detail{
  81. display: flex;
  82. flex-flow: column nowrap;
  83. flex: 1;
  84. height: 90px;
  85. margin-left: 20px;
  86. justify-content: space-between;
  87. }
  88. .public-comment-reply > .reply > div > .reply-detail > .dianzan{
  89. display: flex;
  90. flex-flow: row nowrap;
  91. justify-content: space-between;/* 或者使用下面的*/
  92. }
  93. /*.public-comment-reply > .reply > div > .reply-detail > .dianzan > span:last-child{*/
  94. /* margin-left: auto;*/
  95. /*}*/
  96. /*.public-comment-reply > .reply > div > .reply-detail > .dianzan i{*/
  97. /* color: red;*/
  98. /* font-size: 1.5rem;*/
  99. /*}*/
  100. .public-comment-reply > .reply > div > .reply-detail > .dianzan i:hover{
  101. color: red;
  102. }
声明:本文内容转载自脚本之家,由网友自发贡献,版权归原作者所有,如您发现涉嫌抄袭侵权,请联系admin@php.cn 核实处理。
全部评论
文明上网理性发言,请遵守新闻评论服务协议