Blogger Information
Blog 18
fans 3
comment 3
visits 16201
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
grld仿 (PHP中文网php入门精品课程 )板块
刹那永恒个人博客
Original
953 people have browsed it
  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>6.28Grid布局作业</title>
  7. <style>
  8. /* 初始化 */
  9. * {
  10. padding: 0;
  11. margin: 0;
  12. box-sizing: border-box;
  13. }
  14. a {
  15. text-decoration: none;
  16. color: #666666;
  17. font-size: 14px;
  18. }
  19. /* 大盒子 */
  20. .kecheng {
  21. width: 1200px;
  22. height: 646px;
  23. /* 转为grid */
  24. display: grid;
  25. margin: auto;
  26. }
  27. /* 大标题 */
  28. .kechengtitle {
  29. /* 文字居中 */
  30. text-align: center;
  31. /* 项目自身位置居中 */
  32. place-self: center;
  33. }
  34. /* 课程 */
  35. .container {
  36. /* 转为grid布局 */
  37. display: grid;
  38. /* 设置每个格子的宽高 */
  39. grid-template-columns: repeat(5, 1fr);
  40. grid-template-rows: repeat(3, 1fr);
  41. gap: 5px 5px;
  42. }
  43. .container > div {
  44. width: 217px;
  45. height: 166px;
  46. border-radius: 5%;
  47. box-shadow: 0 0 10px #888;
  48. place-self: start center;
  49. }
  50. .container > .item1 {
  51. /* 设置范围 */
  52. grid-area: 1/1/3/2;
  53. width: 217px;
  54. height: 364px;
  55. }
  56. .container > .item1 {
  57. /* 设置范围 */
  58. grid-area: 1/1/3/2;
  59. width: 217px;
  60. height: 364px;
  61. }
  62. .container > div > a > img {
  63. width: 217px;
  64. height: 124px;
  65. }
  66. .container > .item1 > a > img {
  67. width: 217px;
  68. height: 364px;
  69. border-radius: 5%;
  70. }
  71. item2 > a {
  72. position: relative;
  73. }
  74. .item2 > a > .bofang {
  75. display: block;
  76. width: 100px;
  77. height: 30px;
  78. position: absolute;
  79. font-size: 0.7rem;
  80. margin-top: 130px;
  81. margin-left: 10px;
  82. }
  83. .dongtai {
  84. position: absolute;
  85. width: 217px;
  86. height: 60px;
  87. background-color: #fff;
  88. margin-top: 100px;
  89. /* border-radius: 5%; */
  90. transition: margin 0.3s;
  91. }
  92. .dongtai:hover {
  93. margin-top: 80px;
  94. }
  95. .dongtai > h3 > i {
  96. background-color: #666;
  97. color: #fff;
  98. font-size: 0.99rem;
  99. /* display: inline-block; */
  100. margin: 3px 0;
  101. }
  102. </style>
  103. </head>
  104. <body>
  105. <div class="kecheng">
  106. <div class="kechengtitle"><h3>PHP精品入门课程</h3></div>
  107. <div class="container">
  108. <div class="item1">
  109. <a href=""><img src="imges/index_learn_first.jpg" alt="" /></a>
  110. </div>
  111. <div class="item2">
  112. <a href="">
  113. <div class="dongtai">
  114. <h3><i> 初级 </i> 编程学习方法分享直播</h3>
  115. </div>
  116. <i class="bofang">1w+次播放</i>
  117. <img src="imges/gy.png" alt=""
  118. /></a>
  119. </div>
  120. <div class="item2">
  121. <a href="">
  122. <div class="dongtai">
  123. <h3><i> 初级 </i> 2018前端入门_HTML5</h3>
  124. </div>
  125. <i class="bofang">1w+次播放</i>
  126. <img src="imges/html5.jpg" alt=""
  127. /></a>
  128. </div>
  129. <div class="item2">
  130. <a href="">
  131. <div class="dongtai">
  132. <h3><i> 初级 </i> CSS视频教程-玉女心经</h3>
  133. </div>
  134. <i class="bofang">1w+次播放</i>
  135. <img src="imges/css.jpg" alt=""
  136. /></a>
  137. </div>
  138. <div class="item2">
  139. <a href="">
  140. <div class="dongtai">
  141. <h3><i> 初级 </i> JavaScript极速入门</h3>
  142. </div>
  143. <i class="bofang">1w+次播放</i>
  144. <img src="imges/js.jpg" alt=""
  145. /></a>
  146. </div>
  147. <div class="item2">
  148. <a href="">
  149. <div class="dongtai">
  150. <h3><i> 初级 </i> 独孤九剑(6)</h3>
  151. </div>
  152. <i class="bofang">1w+次播放</i>
  153. <img src="imges/jq.jpg" alt=""
  154. /></a>
  155. </div>
  156. <div class="item2">
  157. <a href="">
  158. <div class="dongtai">
  159. <h3><i> 初级 </i> 30分钟学会网站布局</h3>
  160. </div>
  161. <i class="bofang">1w+次播放</i>
  162. <img src="imges/30.jpeg" alt=""
  163. /></a>
  164. </div>
  165. <div class="item2">
  166. <a href="">
  167. <div class="dongtai">
  168. <h3><i> 初级 </i> 编程学习方法分享直播</h3>
  169. </div>
  170. <i class="bofang">1w+次播放</i>
  171. <img src="imges/qd.jpg" alt=""
  172. /></a>
  173. </div>
  174. <div class="item2">
  175. <a href="">
  176. <div class="dongtai">
  177. <h3><i> 初级 </i> phpStudy极速入门</h3>
  178. </div>
  179. <i class="bofang">1w+次播放</i>
  180. <img src="imges/phpstudy.jpg" alt=""
  181. /></a>
  182. </div>
  183. <div class="item2">
  184. <a href="">
  185. <div class="dongtai">
  186. <h3><i> 初级 </i> TninkPHP6.0极速入门</h3>
  187. </div>
  188. <i class="bofang">1w+次播放</i>
  189. <img src="imges/tp.jpg" alt=""
  190. /></a>
  191. </div>
  192. <div class="item2">
  193. <a href="">
  194. <div class="dongtai">
  195. <h3><i> 初级 </i> 独孤九剑4PHP视频</h3>
  196. </div>
  197. <i class="bofang">1w+次播放</i>
  198. <img src="imges/gdjj4.jpg" alt=""
  199. /></a>
  200. </div>
  201. <div class="item2">
  202. <a href="">
  203. <div class="dongtai">
  204. <h3><i> 初级 </i> php完全自学教程</h3>
  205. </div>
  206. <i class="bofang">1w+次播放</i>
  207. <img src="imges/php.jpg" alt=""
  208. /></a>
  209. </div>
  210. <div class="item2">
  211. <a href="">
  212. <div class="dongtai">
  213. <h3><i> 初级 </i> MySQL权威开发指南</h3>
  214. </div>
  215. <i class="bofang">1w+次播放</i>
  216. <img src="imges/php.jpg" alt=""
  217. /></a>
  218. </div>
  219. <div class="item2">
  220. <a href="">
  221. <div class="dongtai">
  222. <h3><i> 初级 </i> [公益直播]PHP实战开发</h3>
  223. </div>
  224. <i class="bofang">1w+次播放</i>
  225. <img src="imges/gy.png" alt=""
  226. /></a>
  227. </div>
  228. </div>
  229. </div>
  230. </body>
  231. </html>

实际效果

总结

  • VScode编辑器中的资源管理中的大纲对CSS布局帮助很大
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