Blogger Information
Blog 38
fans 0
comment 0
visits 22638
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
仿PHP中文网的热门推荐栏目
一个好人
Original
560 people have browsed it
  1. <h2>热门推荐</h2>
  2. <div class="courses-list">
  3. <div class="course">
  4. <a href="">
  5. <img src="C:\Users\hao_z\Desktop\php\static\picture\hot_courses\hot_course_1.png" alt="">
  6. </a>
  7. <div class="desc">
  8. <div class="title">
  9. <small class="tag chu">初级</small>
  10. <a href="">小白拯救者: PHP7基础语法快速预览</a>
  11. </div>
  12. <div class="other">
  13. <span>88787次学习</span>
  14. <!-- <div class="shoucang">
  15. <input type="checkbox" name="shoucang" id="shoucang">
  16. <label for="shoucang">收藏</label>
  17. </div> -->
  18. <a href="" class="shoucang">☆ 收藏</a>
  19. </div>
  20. </div>
  21. </div>
  1. body{
  2. background-color: #efefef;
  3. padding: 2px;
  4. }
  5. body a{
  6. text-decoration: none;
  7. color: #555;
  8. font-size: small;
  9. }
  10. body a:hover{
  11. color: red;
  12. }
  13. .hot_courses{
  14. width: 1020px;
  15. /* border: 1px solid black; */
  16. /* 居中 */
  17. margin: 0 auto;
  18. }
  19. .hot_courses .courses-list{
  20. display: grid;
  21. grid-template-columns: repeat(5, 1fr);
  22. gap: 30px 10px;
  23. }
  24. .courses-list .course{
  25. background-color: white;
  26. border-radius: 5px;
  27. /* 溢出隐藏 */
  28. overflow: hidden;
  29. }
  30. .chu{
  31. color: #00aaff;
  32. background-color: hsla(196, 79%, 94%, 0.782);
  33. }
  34. .zhong{
  35. color: red;
  36. background-color: rgb(241, 204, 190);
  37. /* opacity: 40%; */
  38. }
  39. .hot_courses .courses-list img{
  40. /* 100%填充 */
  41. width: 100%;
  42. border-radius: 5px 5px 0 0;
  43. }
  44. .hot_courses .courses-list img:hover{
  45. transform: scale(1.1);
  46. transition: 0.3s;
  47. }
  48. .hot_courses .courses-list .desc{
  49. padding: 15px;
  50. }
  51. .hot_courses .courses-list .desc .tag{
  52. border-radius: 2px;
  53. padding: 2px 5px;
  54. font-size: x-small;
  55. }
  56. .hot_courses .courses-list .title>a{
  57. font-weight: 500;
  58. }
  59. .hot_courses .courses-list .title{
  60. height: 40px;
  61. overflow: hidden;
  62. }
  63. .hot_courses .courses-list .desc .other{
  64. color: #aaa;
  65. font-size: x-small;
  66. display: flex;
  67. place-content: space-between;
  68. margin-top: 10px;
  69. }
  70. .hot_courses .courses-list .desc .other>a{
  71. color: #aaa;
  72. font-size: x-small;
  73. }

仿PHP中文网热门推荐

总结:

能看出来的效果基本都放上了,还有几点不足:收藏应该不是a标签,效果像CheckBox,但用CheckBox做不出来一样的效果;颜色不好调,应该是没掌握技巧。

Correcting teacher:PHPzPHPz

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