• WordPress主题网站首页添加好看的四格小工具教程


    直接到网站根目录创建一个css文件(文件名:sige.css),文件名可自定义(注意文件名一致)

    <link rel="stylesheet" href="你的网站/sige.css" type="text/css" >

    然后在header.php模板最上方添加引入代码

    也可自定义HTML里添加css代码最上方写入标签<style>,将css代码放入标签内即可!

    css代码如下:

    1. .hide_sm{display: flex;}
    2. .container .col-1-4{float: left;box-sizing: border-box;margin-right: 7.3333px;width: 100%;}
    3. .container .col-1-4:last-child{margin-right: 0;}
    4. @media (min-width:768px){.container .col-1-4{width: 50%}}
    5. @media (min-width:1024px){.container .col-1-4{width: 25%}}
    6. @media (min-width:1024px){.ripro-dark .home-first{background: #232425;}}
    7. @media (min-width:768px){.home-first .h-images:after{display: none}}
    8. @media (min-width:768px){.home-first .h-images{display: box;display: -ms-flexbox;display: flex;width: 100%;justify-content: space-between}}
    9. @media (min-width:1024px){.home-first .h-images{width: 25%}}
    10. .home-first .h-images .item-tuwen{float: left;padding: 0 6.5px;width: 50%}
    11. @media (min-width:1024px){.home-first .h-images .item-tuwen{float: none}}
    12. @media (min-width:1024px){.home-first .h-images{display: block;box-sizing: border-box;padding: 0 7.3333px}.home-first .h-images .item-tuwen{padding: 0;width: auto}}
    13. .home-first .item-tuwen{margin-bottom: 15px}
    14. @media (min-width:768px){.home-first .item-tuwen{margin-bottom: 13px}}
    15. .home-first .item-tuwen a{position: relative;display: block;overflow: hidden;border-radius: 3px}
    16. .home-first .item-tuwen a .thumb{padding-top: 57%;transition: all .2s;transform-origin: center}
    17. .home-first .item-tuwen a strong{position: absolute;right: 0;bottom: 0;left: 0;z-index: 10;display: block;padding: .4em .8em .6em;background-image: linear-gradient(to bottom,rgba(0,0,0,.2) 0,rgba(0,0,0,.6) 100%);background-repeat: repeat-x;box-shadow: 0 -7px 15px rgba(0,0,0,.2);color: #fff;letter-spacing: .5px;font-weight: 700;font-size: 9pt;line-height: 1.3}
    18. @media (min-width:768px){.home-first .item-tuwen a strong{letter-spacing: 1px;font-size: 14px;line-height: 1.4}}
    19. .home-first .hf-widget{box-sizing: border-box;padding: 14px 17px 0;background: #17161600;box-shadow: 0 34px 20px -24px rgba(220, 220, 220, 0.18);border-radius: 3px;}
    20. .ripro-dark .home-first .hf-widget{border: 1px solid #2b2b2b;background: #232425;box-shadow: 8px 8px 9pt #212121;}
    21. @media (min-width:768px){.home-first .hf-widget{overflow: hidden;height: 135px}}
    22. @media (min-width:1024px){.home-first .hf-widget{margin-bottom: 0}}
    23. .home-first .hf-widget [class*=" icon-"]:before,.home-first .hf-widget [class^=icon-]:before{margin: 0}
    24. .home-first .hf-widget .hf-widget-title{margin-bottom: 14px;padding: 0 0 10px;border-bottom: 1px solid #f2f2f2;color: #383838;letter-spacing: 1px;font-weight: 700;font-size: 15px;line-height: 20px;margin-bottom: 10px;}
    25. .ripro-dark .home-first .hf-widget .hf-widget-title{border-bottom: 1px solid #696969;}
    26. .ripro-dark .home-first .hf-widget .hf-widget-title a{color: #ccc;}
    27. .home-first .hf-widget .hf-widget-title>i{margin-right: 2px;color: #448aff;}
    28. .ripro-dark .home-first .hf-widget .hf-widget-title>i{margin-right: 2px;color: #ffa363}
    29. .home-first .hf-widget .hf-widget-title span{margin-left: 10px;color: #a7a7a7;font-weight: 400;font-size: 9pt;line-height: 20px}
    30. @media (min-width:1024px){.home-first .hf-widget .hf-widget-title span{display: none}}
    31. @media (min-width:1330px){.home-first .hf-widget .hf-widget-title span{display: inline}}
    32. .home-first .hf-widget .hf-widget-title .pages{float: right;padding-top: 2px}
    33. .home-first .hf-widget .hf-widget-title .pages .next,.home-first .hf-widget .hf-widget-title .pages .prev{float: left;margin: 0;padding: 0 2px;height: 1pc;border: 1px solid #eee;color: #ccc;font-size: 9px;line-height: 15px;cursor: pointer}
    34. .home-first .hf-widget .hf-widget-title .pages .next:hover,.home-first .hf-widget .hf-widget-title .pages .prev:hover{color: #448aff}
    35. .home-first .hf-widget .hf-widget-title .pages .prev{border-right: none}
    36. .home-first .hf-widget .hf-tags{margin-bottom: -10px}
    37. @media (min-width:768px){.home-first .hf-widget .hf-tags{overflow: hidden;height: 4pc}}
    38. .home-first .hf-widget .hf-tags a{display: inline-block;margin: 0 5px 10px;padding: 0 5px;height: 22px;border-radius: 2px;background: #f9f9f9;color: #888;white-space: nowrap;font-size: 9pt;line-height: 22px;word-break: break-all}
    39. .home-first .hf-widget .hf-tags a.style_orange,.home-first .hf-widget .hf-tags a:hover{background: #448aff;color: #fff;}
    40. .ripro-dark .home-first .hf-widget .hf-tags a{background: #2c2e2f;}
    41. .home-first .hf-widget-4 .hf-widget-content{color: #888;font-size: 14px}
    42. .home-first .hf-widget-4 .hf-widget-content a{color: #888}
    43. .home-first .hf-widget-4 .hf-widget-content a:hover{color: #448aff;}
    44. .home-first .hf-widget-4 .hf-widget-content h3{overflow: hidden;height: 22px;font-weight: 400;font-size: 13px;line-height: 22px;margin: 0 0 10px;}
    45. .home-first .hf-widget-4 .hf-widget-content em{float: right;padding: 0 5px;height: 22px;border-radius: 2px;background: #fff5ef;color: #ff5c00;font-style: normal;font-size: 9pt;line-height: 22px}
    46. .home-first .hf-widget-4 .hf-widget-content ul li{margin-bottom: 5px}
    47. .home-first .hf-widget-4 .hf-widget-content ul li:last-child{margin-bottom: 0}
    48. .home-first .hf-widget-1 .hf-widget-content a{color: #888}
    49. .ripro-dark .home-first .hf-widget-1 .hf-widget-content a{color: #ccc}
    50. .home-first .hf-widget-1 .hf-widget-content a:hover{color: #69a1ff;}
    51. .home-first .hf-widget-1 .hf-widget-content li{float: left;box-sizing: border-box;padding: 0 10px;width: 25%;text-align: center;font-size: 9pt}
    52. .home-first .hf-widget-1 .hf-widget-content li .thumb{margin: 0 auto 4px;padding-top: 36px;width: 36px}
    53. .home-first .hf-widget-1 .hf-widget-content li span{display: block; height: 16px; line-height: 16px; overflow: hidden;}
    54. .home-first .hf-widget-1 .hf-widget-content .scroll-h{margin: 0 -10px;}
    55. .home-first .scroll-h{position: relative;overflow: hidden;height: 56px;}
    56. .home-first .scroll-h ul{list-style: none;position: absolute;top: 0;left: 0;width: 100%;transition: all .2s; margin:0;padding-left:0;}
    57. .home-first .scroll-h ul:after,.home-first .scroll-h ul:before{clear: both;display: block;visibility: none;height: 0;content: "";line-height: 0}
    58. .home-first .scroll-h .holdon{position: absolute;top: 0;left: 100%}
    59. .home-first .scroll-h .holdon-prev{left: -100%}
    60. .home-first .hf-widget-hot-cats .hhicon{display: inline-block;margin-bottom: 5px;width: 36px;height: 36px;border-radius: 100%;background: #e8fbff;color: #448aff;text-align: center;font-size: 20px;line-height: 36px;}
    61. .ripro-dark .home-first .hf-widget-hot-cats .hhicon{background: #2c2e2f;color: #ffa363;}
    62. .home-first .hf-widget-hot-cats .scroll-h li a{display: block}
    63. .home-first .hf-widget-hot-cats .scroll-h li a:hover .hhicon{background: #448aff;color: #fff;}
    64. .home-first .thumb{position: relative;display: block;overflow: hidden;padding-top: 66.7%;width: 100%;height: 0;background-color: transparent;background-position: center;background-size: cover;background-repeat: no-repeat;transition: all .2s}
    65. .home-first i{font-weight: 300}
    66. @media screen and (max-width:720px){.home-first .hf-widget-1 .hf-widget-content .scroll-h,.home-first .hf-widget-content{margin: 1pc -10px}}
    67. @media (max-width: 768px){.sxweb {display:none;}}
    68. .icon-b i{
    69. display: inline-block;
    70. margin-bottom: 5px;
    71. width: 36px;
    72. height: 36px;
    73. border-radius: 100%;
    74. background: #e8fbff;
    75. color: #448aff;
    76. text-align: center;
    77. font-size: 20px;
    78. line-height: 36px;
    79. }
    80. .icon-b i:hover{
    81. background: #448aff;
    82. color: #fff;
    83. }

    外观-小工具-自定义HTML添加如下代码

    1. <div class="section">
    2. <div class="home-first">
    3. <div class="container hide_sm">
    4. <div class="col-1-4">
    5. <div class="hf-widget hf-widget-1 hf-widget-software">
    6. <h3 class="hf-widget-title">
    7. <i class="fa fa-cloud"></i>
    8. <a href="#" target="_blank">推荐产品</a>
    9. <span>云服务器等云产品推荐</span>
    10. </h3>
    11. <div class="hf-widget-content">
    12. <div class="scroll-h">
    13. <ul>
    14. <li>
    15. <a href="#" rel="external nofollow" target="_blank">
    16. <i class="thumb " style="background-image:url(https://ae01.alicdn.com/kf/H026cdceabc1942e1b82b1eb2cd5b9e41P.png)"></i>
    17. <span>阿里云</span></a>
    18. </li>
    19. <li>
    20. <a href="#" target="_blank">
    21. <i class="thumb " style="background-image:url(https://ae01.alicdn.com/kf/H006240f97bff40f5aea223eb51b33c3dq.png)"></i>
    22. <span>腾讯云</span></a>
    23. </li>
    24. <li>
    25. <a href="#" target="_blank">
    26. <i class="thumb " style="background-image:url(https://ae01.alicdn.com/kf/H2da200a36ce2401595f8e03f8c750deeT.png)"></i>
    27. <span>企业云</span></a>
    28. </li>
    29. <li>
    30. <a href="#" target="_blank">
    31. <i class="thumb " style="background-image:url(https://ae01.alicdn.com/kf/H128bb4d1c77d4f6f9032b934a6a234beD.png)"></i>
    32. <span>香港云</span></a>
    33. </li>
    34. </ul>
    35. </div>
    36. </div>
    37. </div>
    38. </div>
    39. <div class="col-1-4 sxweb">
    40. <div class="hf-widget hf-widget-2">
    41. <h3 class="hf-widget-title">
    42. <i class="fa fa-tint"></i>
    43. <a href="#" target="_blank">热门看点</a>
    44. <span>精品内容推荐</span></h3>
    45. <div class="hf-widget-content">
    46. <div class="no-scroll hf-tags">
    47. <a class="style_orange" href="http://www.lxh5068.com" target="_blank">
    48. <span>手机壁纸</span></a>
    49. <a class="" href="/topics/jc-fx" target="_blank">
    50. <span>教程分享</span></a>
    51. <a class="" href="/topics/wz-ym" target="_blank">
    52. <span>源码分享</span></a>
    53. <a class="" href="/topics/rj-android" target="_blank">
    54. <span>Android软件</span></a>
    55. <a class="" href="/topics/xw-zx" target="_blank">
    56. <span>新闻资讯</span></a>
    57. <a class="" href="/xb-zh" target="_blank">
    58. <span>线报活动</span></a>
    59. <a class="" href="/topics/meihua" target="_blank">
    60. <span>美化代码</span></a>
    61. </div>
    62. </div>
    63. </div>
    64. </div>
    65. <div class="col-1-4 sxweb">
    66. <div class="hf-widget hf-widget-1 hf-widget-hot-cats">
    67. <h3 class="hf-widget-title">
    68. <i class="fa fa-dropbox"></i>
    69. <a href="http://bbs.lxh5068.com/sort/huodong" target="_blank">热门专区</a>
    70. <span>推荐设计热点</span></h3>
    71. <div class="hf-widget-content">
    72. <div class="icon-b">
    73. <ul>
    74. <li>
    75. <a href="http://bbs.lxh5068.com/sort/zhide" target="_blank">
    76. <i class="fa fa-thumbs-up" aria-hidden="true"></i>
    77. <span>每日推荐</span></a>
    78. </li>
    79. <li>
    80. <a href="http://bbs.lxh5068.com/sort/mianfeirj" target="_blank">
    81. <i class="fa fa-cloud-download" aria-hidden="true"></i>
    82. <span>软件下载</span></a>
    83. </li>
    84. <li>
    85. <a href="http://bbs.lxh5068.com/sort/yuanma" target="_blank">
    86. <i class="fa fa-graduation-cap"></i>
    87. <span>源码教程</span></a>
    88. </li>
    89. <li>
    90. <a href="http://bbs.lxh5068.com/sort/guanzhu" target="_blank">
    91. <i class="fa fa-picture-o" aria-hidden="true"></i>
    92. <span>福利美图</span></a>
    93. </li>
    94. </ul>
    95. </div>
    96. </div>
    97. </div>
    98. </div>
    99. <div class="col-1-4 sxweb">
    100. <div class="hf-widget hf-widget-4">
    101. <h3 class="hf-widget-title">
    102. <i class="fa fa-book"></i>
    103. <a href="#" target="_blank">最新活动</a>
    104. <span>免费会员享福利</span>
    105. </h3>
    106. <div class="hf-widget-content">
    107. <div class="scroll-h">
    108. <ul>
    109. <li>
    110. <h3>
    111. <a href="#" target="_blank">
    112. <i class="icon-time"></i>
    113. <span>美化服务火热售卖中</span>
    114. <em>网站美化</em></a>
    115. </h3>
    116. </li>
    117. <li>
    118. <h3>
    119. <a href="#" target="_blank">
    120. <i class="icon-time"></i>
    121. <span>关于本站学分付费阅读获取内容说明</span>
    122. <em>学分说明</em></a>
    123. </h3>
    124. </li>
    125. </ul>
    126. </div>
    127. </div>
    128. </div>
    129. </div>
    130. </div>
    131. </div>
    132. </div>

  • 相关阅读:
    Ubuntu22.04系统 Cgroup v2 切换成v1
    leecode#只出现一次数字#环形链表
    【电磁】基于Matlab实现理想圆柱形电流片的精确磁场
    NIO知识总结三
    使用MySQL和SQL Server生成最近七天的日期
    抛开去中心化叙事 我们需要DAO的4个理由
    【vue后台管理系统】基于Vue+Element-UI+ECharts开发通用管理后台(中)
    kafka-listener
    链上房产赛道项目 ESTATEX 研报:以 RWA 的方式释放房产市场的潜力
    旅游组团自驾游拼团系统 微信小程序python+java+node.js+php
  • 原文地址:https://blog.csdn.net/qq_39910486/article/details/133283283