Blogger Information
Blog 7
fans 0
comment 1
visits 1842
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
"热门推荐"课程列表组件(Grid)
PHP中文网用户-6406556
Original
235 people have browsed it

代码展示

html

  1. <div class="course">
  2. <div class="biaoti">
  3. <h2>热门推荐</h2>
  4. <span class="gengduo">更多</span>
  5. </div>
  6. <div class="courses-list">
  7. <!-- 课程 -->
  8. <div class="list">
  9. <!-- 课程图片 -->
  10. <a href="">
  11. <img src="111.jpg" alt="" />
  12. </a>
  13. <!-- 课程描述 -->
  14. <div class="desc">
  15. <div class="title">
  16. <small class="tag">中级</small>
  17. <a href="">Golang深入理解GPM模型</a>
  18. </div>
  19. <div class="other">
  20. <span>600次学习</span>
  21. <span><span class="iconfont icon-shoucang"></span>收藏</span>
  22. </div>
  23. </div>
  24. </div>
  25. </div>

css

  1. body {
  2. background-color: #efefef;
  3. }
  4. body a {
  5. text-decoration: none;
  6. color: #555;
  7. font-size: small;
  8. }
  9. body a:hover {
  10. color: red;
  11. }
  12. .course {
  13. width: 1020px;
  14. }
  15. /* 布局 */
  16. .biaoti {
  17. display: flex;
  18. place-content: space-between;
  19. place-items: center;
  20. }
  21. .courses-list {
  22. display: grid;
  23. grid-template-columns: repeat(5, 1fr);
  24. gap: 30px 10px;
  25. }
  26. .list img {
  27. width: 100%;
  28. border-radius: 5px 5px 0 0;
  29. position: static;
  30. z-index: 1;
  31. }
  32. /* 图片放大 */
  33. .list img:hover {
  34. transform: scale(1.1);
  35. transition: 0.3s;
  36. }
  37. .course {
  38. /* border: 1px solid #000; */
  39. }
  40. .list {
  41. background-color: white;
  42. border-radius: 5px;
  43. /* 图片溢出隐藏 */
  44. overflow: hidden;
  45. }
  46. .list .desc {
  47. padding: 15px;
  48. position: static;
  49. z-index: 2;
  50. }
  51. .list .desc .tag {
  52. font-size: x-small;
  53. color: blue;
  54. background-color: lightcyan;
  55. padding: 3px 5px;
  56. border-radius: 3px;
  57. }
  58. .list .desc a {
  59. line-height: 22px;
  60. }
  61. .list .desc .other {
  62. color: #aaa;
  63. font-size: xx-small;
  64. display: flex;
  65. place-content: space-between;
  66. margin-top: 8px;
  67. }
  68. .other .iconfont {
  69. font-size: 12px;
  70. margin-right: 3px;
  71. }
  72. .other span:last-child:hover {
  73. cursor: pointer;
  74. color: red;
  75. }

Correcting teacher:PHPzPHPz

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
1 comments
PHP中文网用户-6406556 2023-03-27 16:31:40
层级不知道该如何做
1 floor
Author's latest blog post
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!