博客列表 >php中文网右侧区域的实例演示

php中文网右侧区域的实例演示

lucaslwk
lucaslwk原创
2022年03月26日 17:22:34331浏览

php中文网右侧区域的实例演示

实现效果

实现效果

html 部分

  1. <div class="box">
  2. <div class="container info">
  3. <div class="user">
  4. <div class="content">
  5. <a href="" class="userimg"
  6. ><img src="static/image/user_avatar.jpg" alt=""
  7. /></a>
  8. <a href="" class="username">用户名</a>
  9. <span class="ppoint">P豆 100.00</span>
  10. </div>
  11. <div class="button">我的学习</div>
  12. </div>
  13. <ul class="news">
  14. <div class="item1">
  15. <li class="content">问答社区</li>
  16. <a href="" class="content">答疑</a>
  17. </div>
  18. <li class="item2">头条</li>
  19. <a href="" class="content">美国Figma封停大疆等被制裁中</a>
  20. <li class="item3">新课</li>
  21. <a href="" class="content">3.9号公益直播课</a>
  22. <li class="item4">新版</li>
  23. <a href="" class="content">19期PHP直播班</a>
  24. <li class="item5">招募</li>
  25. <a href="" class="content">课程合作计划</a>
  26. <li class="item6">公告</li>
  27. <a href="" class="content">APP上线了</a>
  28. </ul>
  29. </div>
  30. <div class="container contact">
  31. <b class="iconfont icon-weixin1"></b>
  32. <b class="iconfont icon-QQ-circle-fill"></b>
  33. <a href="" class="weixin">官方公众号</a>
  34. <a href="" class="qq">官方QQ群</a>
  35. </div>
  36. </div>

css 部分

  1. * {
  2. margin: 0;
  3. padding: 0;
  4. box-sizing: 0;
  5. }
  6. a {
  7. text-decoration: none;
  8. color: black;
  9. }
  10. body {
  11. background-color: rgb(243, 245, 247);
  12. }
  13. li {
  14. list-style: none;
  15. }
  16. body {
  17. display: grid;
  18. place-content: center;
  19. padding: 20px;
  20. }
  21. .box {
  22. display: grid;
  23. width: 190px;
  24. grid-template-rows: 400px 80px;
  25. gap: 10px;
  26. }
  27. .container {
  28. background-color: #fff;
  29. border-radius: 20px;
  30. }
  31. .info .user .content .userimg > img {
  32. width: 100%;
  33. border-radius: 50%;
  34. }
  35. .info {
  36. display: grid;
  37. width: 190px;
  38. grid-template-rows: 142px 1fr;
  39. grid-auto-rows: 0;
  40. }
  41. .info .user {
  42. display: grid;
  43. width: 190px;
  44. grid-template-rows: 60px 1fr;
  45. place-items: center;
  46. border-bottom: 2px solid gainsboro;
  47. }
  48. .info .user .button {
  49. background-color: red;
  50. color: #fff;
  51. width: 150px;
  52. height: 34px;
  53. border-radius: 100px;
  54. display: flex;
  55. place-content: center;
  56. place-items: center;
  57. }
  58. .info .user .content {
  59. margin-top: 20px;
  60. padding: 20px;
  61. display: grid;
  62. grid-template-rows: 18px 16px;
  63. grid-template-columns: 40px 105px;
  64. gap: 10px;
  65. }
  66. .info .user .content .userimg {
  67. grid-row: span 2;
  68. }
  69. .info .user .content .username {
  70. font-size: large;
  71. font-weight: bold;
  72. }
  73. .info .user .content .username:hover {
  74. font-size: large;
  75. font-weight: bold;
  76. color: red;
  77. }
  78. .info .user .content .ppoint {
  79. font-size: x-small;
  80. font-weight: lighter;
  81. }
  82. .info .news {
  83. display: grid;
  84. height: 1fr;
  85. grid-template-columns: 40px 1fr;
  86. grid-template-rows: 18px 40px repeat(4, 18px);
  87. font-size: 10px;
  88. gap: 5px;
  89. place-content: space-between space-between;
  90. }
  91. .info .news .item1 {
  92. grid-column: span 2;
  93. margin-right: 20px;
  94. display: flex;
  95. }
  96. .info .news {
  97. margin: 20px;
  98. }
  99. .info .news .item1 .content {
  100. margin-right: 10px;
  101. }
  102. .info .news .item1 li {
  103. margin-right: 10px;
  104. }
  105. .info .news .item1 a {
  106. background-color: #ff583d;
  107. height: 16px;
  108. color: #fff;
  109. font-size: x-small;
  110. width: 31px;
  111. text-align: center;
  112. }
  113. .info .news li {
  114. font-size: 14px;
  115. font-weight: 600;
  116. }
  117. .info .news a {
  118. font-size: 14px;
  119. font-weight: lighter;
  120. color: #b6b6b6;
  121. }
  122. .contact {
  123. display: grid;
  124. grid-template-rows: 30px 16px;
  125. grid-template-columns: 60px 60px;
  126. padding: 13px 20px;
  127. place-content: center;
  128. gap: 5px 30px;
  129. }
  130. .contact a {
  131. font-size: 12px;
  132. font-weight: bold;
  133. }
  134. .contact .iconfont {
  135. font-size: 30px;
  136. color: #b6b6b6;
  137. text-align: center;
  138. }
声明:本文内容转载自脚本之家,由网友自发贡献,版权归原作者所有,如您发现涉嫌抄袭侵权,请联系admin@php.cn 核实处理。
全部评论
文明上网理性发言,请遵守新闻评论服务协议