博客列表 >grid仿PHP中文网 php入门精品课程栏目

grid仿PHP中文网 php入门精品课程栏目

浪子修罗记录有趣的事
浪子修罗记录有趣的事原创
2020年06月29日 01:32:58628浏览

grid仿PHP中文网 php入门精品课程

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6. <title>flex-grid</title>
  7. <style>
  8. * {
  9. margin: 0;
  10. padding: 0;
  11. box-sizing: border-box;
  12. }
  13. html,
  14. body {
  15. width: 100%;
  16. height: 100%;
  17. overflow: hidden;
  18. overflow-y: auto;
  19. font: 14px 微软雅黑;
  20. background: #f3f5f7;
  21. }
  22. a {
  23. text-decoration: none;
  24. }
  25. .container {
  26. width: 1200px;
  27. height: 650px;
  28. margin: 10px auto;
  29. background: #fff;
  30. display: grid;
  31. grid-template-columns: repeat(5, 20%);
  32. grid-template-rows: 80px 190px 190px 190px;
  33. }
  34. .container .item:first-of-type {
  35. grid-column: span 5;
  36. line-height: 80px;
  37. text-align: center;
  38. font-size: 1.5em;
  39. font-weight: 800;
  40. color: #4d555d;
  41. }
  42. .container .item:nth-child(2) {
  43. grid-row: span 2;
  44. margin: 0 auto;
  45. /* background: red; */
  46. }
  47. .container .item:nth-child(2) img {
  48. border-radius: 8px;
  49. }
  50. .container .item:nth-child(n + 3) {
  51. margin: 0 auto;
  52. position: relative;
  53. }
  54. .container .item:nth-child(n + 3) img {
  55. width: 217px;
  56. height: 124px;
  57. border-radius: 8px;
  58. }
  59. a {
  60. display: block;
  61. border-radius: 8px;
  62. padding: 15px 20px;
  63. position: absolute;
  64. top: 94px;
  65. transition: top 0.5s;
  66. height: 90px;
  67. width: 100%;
  68. background: #fff;
  69. color: #555;
  70. }
  71. .container .item:nth-child(n + 3) a:hover {
  72. color: #333;
  73. top: 50px;
  74. }
  75. .container .item:nth-child(n + 3) span {
  76. position: absolute;
  77. top: 130px;
  78. left: 0;
  79. width: 217px;
  80. height: 40px;
  81. padding: 0 20px;
  82. line-height: 40px;
  83. background: #fff;
  84. color: #93999f;
  85. font-size: 12px;
  86. border-bottom-left-radius: 8px;
  87. border-bottom-right-radius: 8px;
  88. box-shadow: 0 4px 8px 0 rgba(7, 17, 27, 0.1);
  89. }
  90. .container .item i {
  91. font-size: 0.5em;
  92. margin-right: 5px;
  93. padding: 2px;
  94. color: white;
  95. background-color: rgba(0, 0, 0, 0.239);
  96. }
  97. </style>
  98. </head>
  99. <body>
  100. <div class="container">
  101. <div class="item">php入门精品课程</div>
  102. <div class="item"><img src="images/01.jpg" alt="" /></div>
  103. <div class="item">
  104. <img src="images/02.png" alt="" />
  105. <a href=""><i>初级</i>编程学习方法分享直播公益课</a>
  106. <span>1W+次播放</span>
  107. </div>
  108. <div class="item">
  109. <img src="images/03.jpg" alt="" />
  110. <a href=""><i>初级</i>2018前端入门_HTML5</a>
  111. <span>18W+次播放</span>
  112. </div>
  113. <div class="item">
  114. <img src="images/04.jpg" alt="" />
  115. <a href=""><i>初级</i>CSS视频教程-玉女心经版</a>
  116. <span>10W+次播放</span>
  117. </div>
  118. <div class="item">
  119. <img src="images/05.jpg" alt="" />
  120. <a href=""><i>初级</i>JavaScript极速入门_玉女心经系列</a>
  121. <span>18W+次播放</span>
  122. </div>
  123. <div class="item">
  124. <img src="images/06.jpg" alt="" />
  125. <a href=""><i>初级</i>独孤九贱(6)_jQuery视频教程</a>
  126. <span>12W+次播放</span>
  127. </div>
  128. <div class="item">
  129. <img src="images/07.jpg" alt="" />
  130. <a href=""><i>初级</i>30分钟学会网站布局</a>
  131. <span>6W+次播放</span>
  132. </div>
  133. <div class="item">
  134. <img src="images/08.jpg" alt="" />
  135. <a href=""><i>初级</i>ThinkPHP6.0极速入门(视频教程)</a>
  136. <span>4W+次播放</span>
  137. </div>
  138. <div class="item">
  139. <img src="images/09.jpg" alt="" />
  140. <a href=""><i>初级</i>[公益直播]Web前端开发极速入门</a>
  141. <span>5W+次播放</span>
  142. </div>
  143. <div class="item">
  144. <img src="images/10.jpg" alt="" />
  145. <a href=""><i>初级</i>phpStudy极速入门视频教程</a>
  146. <span>40W+次播放</span>
  147. </div>
  148. <div class="item">
  149. <img src="images/11.jpg" alt="" />
  150. <a href=""><i>初级</i>ThinkPHP6.0极速入门(视频教程)</a>
  151. <span>35W+次播放</span>
  152. </div>
  153. <div class="item">
  154. <img src="images/12.jpg" alt="" />
  155. <a href=""><i>初级</i>php完全自学手册</a>
  156. <span>36W+次播放</span>
  157. </div>
  158. <div class="item">
  159. <img src="images/13.jpg" alt="" />
  160. <a href=""><i>初级</i>MySQL权威开发指南(教程)</a>
  161. <span>4W+次播放</span>
  162. </div>
  163. <div class="item">
  164. <img src="images/14.jpg" alt="" />
  165. <a href=""><i>初级</i>[公益直播]PHP实战开发极速入门</a>
  166. <span>4W+次播放</span>
  167. </div>
  168. </div>
  169. </body>
  170. </html>

原图

仿图

参考了同学老周的作业,学习到了不错运用方式。还要多练手,多练手,多练手,多练手。

重要的事要多说几遍。

声明:本文内容转载自脚本之家,由网友自发贡献,版权归原作者所有,如您发现涉嫌抄袭侵权,请联系admin@php.cn 核实处理。
全部评论
文明上网理性发言,请遵守新闻评论服务协议