博客列表 >grid实战 仿php中文网课程列表

grid实战 仿php中文网课程列表

小追
小追原创
2020年07月03日 09:45:06682浏览

上代码:

  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. <link rel="stylesheet" href="fonticon.css">
  7. <title>0628作业:仿php.cn课程列表</title>
  8. <style>
  9. *{
  10. margin:0;
  11. padding:0;
  12. box-sizing:border-box;
  13. }
  14. a{
  15. text-decoration:none;
  16. color:#666;
  17. font-size:16px;
  18. }
  19. .courses-list{
  20. width:1200px;
  21. height:646px;
  22. margin:auto;
  23. display:grid;
  24. }
  25. .courses-list>.courses-title{
  26. color:#555;
  27. text-align:center;
  28. }
  29. .courses-list>.container{
  30. display:grid;
  31. grid-template-columns:repeat(5,1fr);
  32. grid-template-rows:repeat(3,1fr);
  33. }
  34. .courses-list>.container>.courses{
  35. width:217px;
  36. height:166px;
  37. border-radius:6%;
  38. box-shadow:0 0 10px #888;
  39. place-self:start center;
  40. }
  41. .courses-list>.container>.courses:first-of-type{
  42. grid-row:span 2;
  43. height:362px;
  44. }
  45. .courses-title{
  46. height:80px;
  47. line-height:80px;
  48. }
  49. .courses-title>span{
  50. color:#66bdff;
  51. }
  52. img{
  53. width:100%;
  54. border-radius:6%;
  55. }
  56. .decs{
  57. border-radius:6%;
  58. display:grid;
  59. place-content:space-between;
  60. min-height:84px;
  61. padding:10px;
  62. position:relative;
  63. top:-42px;
  64. background-color:#fff;
  65. }
  66. .decs>a>span{
  67. background-color:#939999;
  68. color:#fff;
  69. font-size:12px;
  70. padding:2px;
  71. border-radius:3px;
  72. }
  73. .decs>span{
  74. font-size:12px;
  75. color:#555;
  76. }
  77. .decs:hover{
  78. min-height:130px;
  79. position:relative;
  80. top:-90px;
  81. cursor:pointer;
  82. transition:top 0.5s;
  83. }
  84. </style>
  85. </head>
  86. <body>
  87. <div class="courses-list">
  88. <h3 class="courses-title"><span class="iconfont">&#xe600;</span>PHP入门精品课程<span class="iconfont">&#xe600;</span></h3>
  89. <div class="container">
  90. <div class="courses">
  91. <a href=""><img src="images/1.jpg" alt="" /></a>
  92. </div>
  93. <div class="courses">
  94. <a href=""><img src="images/2.jpg" alt="" /></a>
  95. <div class="decs"><a href=""><span>中级</span>独孤九贱(7)_Bootstrap视频教程</a>
  96. <span>1.6W+次播放</span></div>
  97. </div>
  98. <div class="courses">
  99. <a href=""><img src="images/3.jpg" alt="" /></a>
  100. <div class="decs"><a href=""><span>中级</span>最新ThinkPHP 5.1全球首发视频教程</a>
  101. <span>1.6W+次播放</span></div>
  102. </div>
  103. <div class="courses">
  104. <a href=""><img src="images/4.jpg" alt="" /></a>
  105. <div class="decs"><a href=""><span>中级</span>MySQLi面向对象编程极速入门</a>
  106. <span>1.6W+次播放</span></div>
  107. </div>
  108. <div class="courses">
  109. <a href=""><img src="images/5.jpg" alt="" /></a>
  110. <div class="decs"><a href=""><span>中级</span>PDO操作极速入门,今天你用了吗?</a>
  111. <span>1.6W+次播放</span></div>
  112. </div>
  113. <div class="courses">
  114. <a href=""><img src="images/6.jpg" alt="" /></a>
  115. <div class="decs"><a href=""><span>中级</span>PHP与Ajax极速入门</a>
  116. <span>1.6W+次播放</span></div>
  117. </div>
  118. <div class="courses">
  119. <a href=""><img src="images/7.jpg" alt="" /></a>
  120. <div class="decs"><a href=""><span>中级</span>正则表达式极速入门</a>
  121. <span>1.6W+次播放</span></div>
  122. </div>
  123. <div class="courses">
  124. <a href=""><img src="images/8.jpg" alt="" /></a>
  125. <div class="decs"><a href=""><span>中级</span>命名空间30分钟极速入门</a>
  126. <span>1.6W+次播放</span></div>
  127. </div>
  128. <div class="courses">
  129. <a href=""><img src="images/9.jpg" alt="" /></a>
  130. <div class="decs"><a href=""><span>中级</span>PHP字符串操作经典入门</a>
  131. <span>1.6W+次播放</span></div>
  132. </div>
  133. <div class="courses">
  134. <a href=""><img src="images/10.jpg" alt="" /></a>
  135. <div class="decs"><a href=""><span>中级</span>CI框架30分钟极速入门</a>
  136. <span>1.6W+次播放</span></div>
  137. </div>
  138. <div class="courses">
  139. <a href=""><img src="images/11.jpg" alt="" /></a>
  140. <div class="decs"><a href=""><span>中级</span>PHP实战天龙八部之微信支付视频教程</a>
  141. <span>1.6W+次播放</span></div>
  142. </div>
  143. <div class="courses">
  144. <a href=""><img src="images/12.jpg" alt="" /></a>
  145. <div class="decs"><a href=""><span>中级</span>PHP实战天龙八部之仿爱奇艺电影网站</a>
  146. <span>1.6W+次播放</span></div>
  147. </div>
  148. <div class="courses">
  149. <a href=""><img src="images/13.jpg" alt="" /></a>
  150. <div class="decs"><a href=""><span>中级</span>大型公益实战天龙八部</a>
  151. <span>1.6W+次播放</span></div>
  152. </div>
  153. <div class="courses">
  154. <a href=""><img src="images/14.jpg" alt="" /></a>
  155. <div class="decs"><a href=""><span>中级</span>php全栈开发之小博客大智慧</a>
  156. <span>1.6W+次播放</span></div>
  157. </div>
  158. </div>
  159. </div>
  160. </body>
  161. </html>

效果:

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