Blogger Information
Blog 31
fans 2
comment 0
visits 27668
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
仿PHP中文网课程模块
霏梦
Original
651 people have browsed it

- 作者:霏梦

HTML代码

  • 其它复制就好了

    1. <div class="course-list">
    2. <h3 class="course-title">php入门精品课程</h3>
    3. <div class="container">
    4. <div class="course-item first">
    5. <a href=""
    6. ><img
    7. src="images/index_learn_first.jpg"
    8. alt="php中文网入门初级教程"
    9. /></a>
    10. </div>
    11. <div class="course-item">
    12. <a href=""
    13. ><img src="images/1.png" alt="编程学习方法分享直播公益课"
    14. /></a>
    15. <div class="desc">
    16. <a href=""><span>初级</span>编程学习方法分享直播公益课</a>
    17. <span>11W+播放</span>
    18. </div>
    19. </div>

    css 代码

    1. /* 初始化 */
    2. * {
    3. margin: 0;
    4. padding: 0;
    5. box-sizing: border-box;
    6. }
    7. a {
    8. text-decoration: none;
    9. font-size: 14px;
    10. color: #666;
    11. }
    12. /* 容器 */
    13. .course-list {
    14. width: 1200px;
    15. height: 646px;
    16. display: grid;
    17. margin: auto;
    18. }
    19. /* 标题 */
    20. .course-list > .course-title {
    21. text-align: center;
    22. color: #4d555d;
    23. font-size: 20px;
    24. padding: 20px 0 0 0;
    25. }
    26. /* 列表 */
    27. .course-list > .container {
    28. display: grid;
    29. grid-template-columns: repeat(5, 1fr);
    30. grid-template-rows: repeat(3, 1fr);
    31. }
    32. .course-list > .container > .course-item {
    33. width: 217px;
    34. height: 166px;
    35. /* background-color: slateblue; */
    36. border-radius: 5px;
    37. box-shadow: 0 0 10px #888;
    38. place-self: start center;
    39. }
    40. /* 第一个列表 */
    41. .course-list > .container > .course-item.first {
    42. width: 217px;
    43. height: 362px;
    44. grid-row: span 2;
    45. }
    46. /* 图片大小 */
    47. .course-list > .container > .course-item img {
    48. width: 100%;
    49. border-radius: 5px;
    50. }
    51. /* 课程描述 */
    52. .course-list > .container > .course-item .desc {
    53. display: grid;
    54. place-content: space between;
    55. min-height: 84px;
    56. border-radius: 5px;
    57. background-color: white;
    58. padding: 10px;
    59. position: relative;
    60. top: -42px;
    61. }
    62. /* 播放 */
    63. .course-list > .container > .course-item .desc span {
    64. color: #93999f;
    65. font-size: 12px;
    66. }
    67. /* 初级 */
    68. .course-list > .container > .course-item .desc a span {
    69. background-color: #93999f;
    70. color: white;
    71. font-size: 12px;
    72. padding: 2px;
    73. border-radius: 1px;
    74. }
    75. /* 有向上动的行为 */
    76. .course-list > .container > .course-item .desc:hover {
    77. min-height: 130px;
    78. cursor: pointer;
    79. position: relative;
    80. top: -90px;
    81. transition: 0.5s;
    82. }
  • 效果图
    php

    总结

  1. 要多理解容器、单元格、项目之间的关系
  2. 要理解不同场景下的应用参数
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