博客列表 >仿php中文网首页头部

仿php中文网首页头部

阿杰
阿杰原创
2022年03月26日 14:24:51389浏览

补充右侧代码

  • html部分
  1. <div class="right">
  2. <div class="top">
  3. <div class="userInfo">
  4. <img src="static/images/user-pic.jpeg" alt="">
  5. <div class="username">朱老师</div>
  6. <div class="usermoney">P豆 855.0</div>
  7. </div>
  8. <div class="myStudy">我的学习</div>
  9. </div>
  10. <div class="bottom">
  11. <div class="item">
  12. <div>问答社区</div>
  13. <div class="answer">答疑</div>
  14. </div>
  15. <div class="item">
  16. <div>头条</div>
  17. <div class="sc">
  18. <div class="cont">
  19. <div>Web3现状如何?能否在政策助推下复刻互联网辉煌?</div>
  20. <div>JetBrains和Gitlab均表明暂停在俄罗斯的业务,国内网友对此有何看法?</div>
  21. <div>首个采用中文编写的操作系统出现了!</div>
  22. </div>
  23. </div>
  24. </div>
  25. <div class="item">
  26. <div>新课</div>
  27. <a href="">3.9号公益直播课</a>
  28. </div>
  29. <div class="item">
  30. <div>新班</div>
  31. <a href="">19期PHP直播班</a>
  32. </div>
  33. <div class="item">
  34. <div>招募</div>
  35. <a href="">课程合作计划</a>
  36. </div>
  37. <div class="item">
  38. <div>公告</div>
  39. <a href="">APP上线啦</a>
  40. </div>
  41. </div>
  42. </div>
  • css 部分
  1. main .navs .right{
  2. display: grid;
  3. grid-template-rows: 142px 1fr;
  4. }
  5. main .navs .right .top{
  6. display: grid;
  7. grid-template-columns: 150px;
  8. place-content: space-evenly center;
  9. border-bottom: 1px solid #efefef;
  10. }
  11. main .navs .right .top .userInfo{
  12. display: grid;
  13. grid-template-columns: 40px 100px;
  14. place-content: space-between;
  15. }
  16. main .navs .right .top .userInfo img{
  17. width: 100%;
  18. grid-row: span 2;
  19. border-radius: 50%;
  20. }
  21. main .navs .right .top .userInfo .username{
  22. font-weight: bold;
  23. }
  24. main .navs .right .top .userInfo .usermoney{
  25. color: #999;
  26. font-size: 10px;
  27. }
  28. main .navs .right .top .myStudy{
  29. background-color: #f11717;
  30. color: #fff;
  31. border-radius: 100px;
  32. height: 34px;
  33. line-height: 34px;
  34. text-align: center;
  35. }
  36. main .navs .right .bottom{
  37. display: grid;
  38. grid-template-columns: 150px;
  39. place-content: space-evenly center;
  40. }
  41. main .navs .right .bottom .item{
  42. display: flex;
  43. }
  44. main .navs .right .bottom .item a{
  45. color: #b6b6b6;
  46. margin-left: 10px;
  47. }
  48. main .navs .right .bottom .item a:hover{
  49. color: #f11717;
  50. }
  51. main .navs .right .bottom .item .answer{
  52. color: #fff;
  53. margin-left: 10px;
  54. background-color: #ff583d;
  55. padding: 0 5px;
  56. border-radius: 2px;
  57. cursor: pointer;
  58. }
  59. main .navs .right .bottom .item .sc{
  60. color: #b6b6b6;
  61. margin-left: 10px;
  62. width: 105px;
  63. height: 38px;
  64. overflow-y: hidden;
  65. }
  66. main .navs .right .bottom .item:nth-of-type(2) .sc .cont{
  67. animation-direction: alternate;
  68. animation: myfirst 2s linear infinite;
  69. }
  70. @keyframes myfirst
  71. {
  72. 0% {margin-top:0px;}
  73. 25% {margin-top:-10px;}
  74. 50% {margin-top:-19px;}
  75. 75% {margin-top:-38px;}
  76. 100% {margin-top:0px;}
  77. }
  78. main .navs .bottom-right{
  79. display: grid;
  80. grid-template-columns: 70px 70px;
  81. place-content: center space-evenly;
  82. position: relative;
  83. }
  84. main .navs .bottom-right .contact{
  85. text-align: center;
  86. }
  87. main .navs .bottom-right .contact .contactIcon{
  88. color: #999;
  89. font-size: 35px;
  90. margin-bottom: 5px;
  91. }
  92. main .navs .bottom-right .contact .contactText{
  93. font-weight: bold;
  94. font-size: 12px;
  95. }
  96. main .navs .bottom-right .contact:first-of-type:hover{
  97. cursor: pointer;
  98. }
  99. main .navs .bottom-right .contact:first-of-type:hover .ewm{
  100. display: block;
  101. }
  102. main .navs .ewm{
  103. position: absolute;
  104. left: 10px;
  105. top: 80px;
  106. background-color: #fff;
  107. text-align: center;
  108. padding: 5px;
  109. border-radius: 5px;
  110. display: none;
  111. }
  112. main .navs .ewm img{
  113. width: 80px;
  114. }
  • 引进两个图标

  • 效果图

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