博客列表 >右侧布局案例

右侧布局案例

平凡之路
平凡之路原创
2022年04月03日 20:44:23295浏览

PH中文网右侧

html代码

  1. <div class="right">
  2. <div class="right-mx">
  3. <div class="right-top">
  4. <a class="tx"href=""><img src="/HTML/img/tx.png" alt=""></a>
  5. <a class="wz" href="">
  6. <span>同步APP学习</span>
  7. </a>
  8. </div>
  9. <div class="right-main">
  10. <button class="dl">登录</button>
  11. <button class="zc">注册</button>
  12. </div>
  13. <div class="right-foot">
  14. <div class="title">
  15. <div class="title1">问答社区</div>
  16. <a href="" class="title2">答疑</a>
  17. </div>
  18. <div class="item">
  19. <ul class="lb">
  20. <li>
  21. <span>头条</span>
  22. <a href="">3.9公益课</a>
  23. </li>
  24. <li>
  25. <span>头条</span>
  26. <a href="">3.8公益课111</a>
  27. </li>
  28. <li>
  29. <span>头条</span>
  30. <a href="">3.8公益课111112</a>
  31. </li>
  32. <li>
  33. <span>头条</span>
  34. <a href="">3.8公益课222</a>
  35. </li>
  36. <li>
  37. <span>头条</span>
  38. <a href="">3.8公益课</a>
  39. </li>
  40. </ul>
  41. </div>
  42. </div>
  43. </div>
  44. </div>

css样式

  1. * {
  2. margin: 0px;
  3. padding: 0px;
  4. box-sizing: border-box;
  5. }
  6. main .right .right-mx {
  7. display: grid;
  8. place-items: center;
  9. grid-template-rows: 60px 90px 250px;
  10. }
  11. main .right .right-top {
  12. display: grid;
  13. grid-template-columns: 40px 110px;
  14. grid-template-rows: 40px;
  15. }
  16. main .right .right-mx .right-top img {
  17. margin-left: 0px;
  18. width: 100%;
  19. border-radius: 100px;
  20. }
  21. main .right .right-top .wz {
  22. margin: 20px 0px 0px 5px;
  23. width: 82px;
  24. font-size: 14px;
  25. color: rgb(139, 139, 139);
  26. }
  27. main .right .right-top .tx {
  28. margin: 10px 0px 0px 0px;
  29. }
  30. main .right .right-top span:hover {
  31. color: red;
  32. }
  33. main .right .right-main button {
  34. width: 70px;
  35. height: 34px;
  36. border: 0px solid black;
  37. border-radius: 16px;
  38. }
  39. main .right .right-mx .right-main {
  40. margin: 28px 10px;
  41. }
  42. main .right .right-main .dl {
  43. background-color: red;
  44. color: #fff;
  45. }
  46. main .right .right-main .zc {
  47. background-color: aliceblue;
  48. border: 1px solid rgb(179, 179, 179);
  49. }
  50. main .right .right-foot {
  51. display: grid;
  52. grid-template-rows: 20px 1fr;
  53. place-items: center;
  54. }
  55. main .right .right-foot .title {
  56. display: grid;
  57. grid-template-columns: 56px 94px;
  58. place-items: center;
  59. }
  60. main .right .right-foot .item {
  61. display: grid;
  62. grid-template-columns: 28px 122px;
  63. }
  64. main .right .right-foot .lb li {
  65. display: grid;
  66. grid-template-columns: 28px 112px;
  67. place-items: center start;
  68. gap: 10px;
  69. }
  70. main .right .right-foot .item a {
  71. margin: 10px 0px;
  72. color: rgb(131, 131, 131);
  73. font-size: 14px;
  74. }
  75. main .right-foot .title2 {
  76. color: #fff;
  77. background-color: coral;
  78. font-size: 14px;
  79. }

效果图

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