Blogger Information
Blog 32
fans 2
comment 0
visits 27929
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
6月28号作业之仿php中文网首页入门精品课程模块
简行
Original
543 people have browsed it

使用grid布局技术,引用阿里图标,鼠标悬停,定位等进行仿php中文网首页入门精品课程模块,如图所示

HTML代码

  1. <body>
  2. <div class="container">
  3. <h3 class="title">
  4. <span class="iconfont icon-daima"></span>php入门精品课程<span
  5. class="iconfont icon-daima"
  6. ></span>
  7. </h3>
  8. <div class="course">
  9. <div class="item">
  10. <img src="./images/index_learn_first.jpg" alt="" />
  11. </div>
  12. <div class="item">
  13. <a href="\"
  14. ><img src="./images/5b244.png" alt="" />
  15. <div class="des">
  16. <div>
  17. <span>初级</span><span>编程学习方法分享直播公益课</span>
  18. </div>
  19. <span>1W+次播放</span>
  20. </div>
  21. </a>
  22. </div>
  23. <div class="item">
  24. <a href="\"
  25. ><img src="./images/5a649.jpg" alt="" />
  26. <div class="des">
  27. <div><span>初级</span><span>2018前端入门_HTML5</span></div>
  28. <span>18W+次播放</span>
  29. </div>
  30. </a>
  31. </div>
  32. <div class="item">
  33. <a href="\"
  34. ><img src="./images/5a4221.jpg" alt="" />
  35. <div class="des">
  36. <div><span>初级</span><span>CSS视频教程-玉女心经版</span></div>
  37. <!-- <p>
  38. 本章节讲解的是有关CSS基础的内容,轻松明快,适合新手观看学习。
  39. </p> -->
  40. <span>18W+次播放</span>
  41. </div>
  42. </a>
  43. </div>
  44. <div class="item">
  45. <a href="\"
  46. ><img src="./images/5a969.jpg" alt="" />
  47. <div class="des">
  48. <div>
  49. <span>初级</span><span>JavaScript极速入门_玉女心经系列</span>
  50. </div>
  51. <span>10W+次播放</span>
  52. </div>
  53. </a>
  54. </div>
  55. <div class="item">
  56. <a href="\"
  57. ><img src="./images/5d633.jpg" alt="" />
  58. <div class="des">
  59. <div>
  60. <span>初级</span><span>独孤九贱(6)_jQuery视频教程</span>
  61. </div>
  62. <span>18W+次播放</span>
  63. </div>
  64. </a>
  65. </div>
  66. <div class="item">
  67. <a href="\"
  68. ><img src="./images/5a707.jpeg" alt="" />
  69. <div class="des">
  70. <div><span>初级</span><span>30分钟学会网站布局</span></div>
  71. <span>6w+次播放</span>
  72. </div>
  73. </a>
  74. </div>
  75. <div class="item">
  76. <a href="\"
  77. ><img src="./images/5d106.jpg" alt="" />
  78. <div class="des">
  79. <div>
  80. <span>初级</span><span>[公益直播]Web前端开发极速入门</span>
  81. </div>
  82. <span>5W+次播放</span>
  83. </div>
  84. </a>
  85. </div>
  86. <div class="item">
  87. <a href="\"
  88. ><img src="./images/5a398.jpg" alt="" />
  89. <div class="des">
  90. <div><span>初级</span><span>phpStudy极速入门视频教程</span></div>
  91. <span>40W+次播放</span>
  92. </div>
  93. </a>
  94. </div>
  95. <div class="item">
  96. <a href="\"
  97. ><img src="./images/5c582.jpg" alt="" />
  98. <div class="des">
  99. <div>
  100. <span>初级</span><span>ThinkPHP6.0极速入门(视频教程)</span>
  101. </div>
  102. <span>4W+次播放</span>
  103. </div>
  104. </a>
  105. </div>
  106. <div class="item">
  107. <a href="\"
  108. ><img src="./images/5d885.jpg" alt="" />
  109. <div class="des">
  110. <div><span>中级</span><span>独孤九贱(4)_PHP视频教程</span></div>
  111. <span>18W+次播放</span>
  112. </div>
  113. </a>
  114. </div>
  115. <div class="item">
  116. <a href="\"
  117. ><img src="./images/5a730.jpg" alt="" />
  118. <div class="des">
  119. <div><span>中级</span><span>php完全自学手册</span></div>
  120. <span>20W+次播放</span>
  121. </div>
  122. </a>
  123. </div>
  124. <div class="item">
  125. <a href="\"
  126. ><img src="./images/5d252.jpg" alt="" />
  127. <div class="des">
  128. <div><span>初级</span><span>MySQL权威开发指南(教程)</span></div>
  129. <span>2W+次播放</span>
  130. </div>
  131. </a>
  132. </div>
  133. <div class="item">
  134. <a href="\"
  135. ><img src="./images/5d731.jpg" alt="" />
  136. <div class="des">
  137. <div>
  138. <span>初级</span><span>[公益直播]PHP实战开发极速入门</span>
  139. </div>
  140. <span>3W+次播放</span>
  141. </div>
  142. </a>
  143. </div>
  144. </div>
  145. </div>
  146. </body>

CSS代码

  1. <style>
  2. * {
  3. padding: 0;
  4. margin: 0;
  5. box-sizing: border-box;
  6. }
  7. body {
  8. background-color: #f3f5f7;
  9. }
  10. .container {
  11. width: 1200px;
  12. height: 646px;
  13. display: grid;
  14. margin: auto;
  15. }
  16. a {
  17. text-decoration: none;
  18. }
  19. /* 模块标题 */
  20. .container > .title {
  21. text-align: center;
  22. padding: 10px 0;
  23. }
  24. .container > .title span {
  25. margin: 15px;
  26. color: rgb(65, 65, 214);
  27. }
  28. /* 课程 */
  29. .container > .course {
  30. display: grid;
  31. grid-template-columns: repeat(5, 1fr);
  32. grid-template-rows: repeat(3, 1fr);
  33. }
  34. .container > .course > .item {
  35. width: 217px;
  36. height: 166px;
  37. /* 设置边框圆角 */
  38. border-radius: 8px;
  39. /* 设置阴影 */
  40. box-shadow: 0 0 10px #888;
  41. /* 项目在单元格中垂直居中 */
  42. place-self: start center;
  43. }
  44. .container > .course > .item:first-of-type {
  45. grid-row: span 2;
  46. height: 364px;
  47. border-radius: 8px;
  48. }
  49. .container > .course > .item:first-of-type img {
  50. width: 100%;
  51. border-radius: 8px;
  52. }
  53. .container > .course > .item > a > img {
  54. width: 100%;
  55. border-radius: 8px;
  56. }
  57. .container > .course > .item > a > .des {
  58. background-color: white;
  59. display: flex;
  60. flex-flow: column nowrap;
  61. justify-content: space-between;
  62. /* place-content: space-sbtween; */
  63. min-height: 84px;
  64. position: relative;
  65. top: -40px;
  66. border-radius: 8px;
  67. }
  68. .container > .course > .item > a > .des:hover {
  69. min-height: 130px;
  70. position: relative;
  71. top: -85px;
  72. }
  73. /* .container > .course > .item > a > .des:hover p {
  74. display: block;
  75. background-color: rgb(219, 7, 156);
  76. } */
  77. .container > .course > .item > a > .des span {
  78. font-size: 12px;
  79. color: #555;
  80. padding: 2px;
  81. margin: 10px;
  82. }
  83. .container > .course > .item > a > .des p {
  84. /* text-align: center; */
  85. padding: 5px 6px 0 6px;
  86. color: #93999f;
  87. font-size: 12px;
  88. height: 30px;
  89. overflow: hidden;
  90. line-height: 20px;
  91. background-color: yellowgreen;
  92. }
  93. /* 调整‘初级’标签 */
  94. .container > .course > .item > a > .des > div > span:first-of-type {
  95. background-color: #939393;
  96. color: white;
  97. border-radius: 2px;
  98. }
  99. </style>
Correcting teacher:GuanhuiGuanhui

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