discuz!N7模板 论坛加一个小导航

[复制链接]
aoki(UID:59) 发表于 2025-1-13 18:31:13 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×


discuz!N7模板 论坛加一个小导航

discuz!N7模板 论坛加一个小导航


  1. <style type="text/css">
  2. /* 容器样式 */
  3. .indexnews-tools {
  4.     width: 100%; /* 容器宽度占满整个父元素 */
  5.     background-color: #fff; /* 背景色设置为白色 */
  6.     padding: 20px 0; /* 上下内边距为20px,左右内边距为0 */
  7.     box-sizing: border-box; /* 确保内边距和边框包含在宽度内 */
  8. }

  9. /* 列表样式 */
  10. .indexnewss-tools {
  11.     list-style: none; /* 移除默认的列表样式 */
  12.     padding: 0; /* 移除默认的内边距 */
  13.     margin: 0; /* 移除默认的外边距 */
  14.     display: flex; /* 使用flex布局 */
  15.     justify-content: center; /* 子元素水平居中 */
  16. }

  17. /* 列表项样式 */
  18. .indexnewss-tools li {
  19.     width: 33.33%; /* 每个列表项宽度占父元素的33.33%,即一行三个 */
  20.     height: 30px; /* 列表项高度为60px */
  21.     display: flex; /* 使用flex布局 */
  22.     align-items: center; /* 子元素垂直居中 */
  23.     justify-content: space-between; /* 子元素水平两端对齐 */
  24.     padding: 0 20px; /* 左右内边距为20px */
  25.     box-sizing: border-box; /* 确保内边距和边框包含在宽度内 */
  26.     border-right: 1px solid #ddd; /* 右侧边框,颜色为浅灰色 */
  27. }

  28. /* 最后一个列表项不显示右侧边框 */
  29. .indexnewss-tools li:last-child {
  30.     border-right: none;
  31. }

  32. /* 图标和文本内容容器样式 */
  33. .indexnewss-tools li .content {
  34.     display: flex; /* 使用flex布局 */
  35.     align-items: center; /* 子元素垂直居中 */
  36. }

  37. /* 图标样式 */
  38. .indexnewss-tools li img {
  39.     width: 30px; /* 图标宽度为30px */
  40.     height: 30px; /* 图标高度为30px */
  41. }

  42. /* 文本内容样式 */
  43. .indexnewss-tools li .text {
  44.     display: flex;
  45.     flex-direction: column; /* 子元素垂直排列 */
  46.     align-items: flex-start; /* 子元素左对齐 */
  47.     justify-content: center; /* 子元素垂直居中 */
  48.     margin-left: 10px; /* 图标和文本之间的间距为10px */
  49. }

  50. /* 标题样式 */
  51. .indexnewss-tools li .text h3 {
  52.     font-size: 14px; /* 字体大小为14px */
  53.     color: #333; /* 字体颜色为深灰色 */
  54.     margin: 0; /* 移除默认的外边距 */
  55.     margin-bottom: 5px; /* 底部外边距为5px */
  56. }

  57. /* 描述文本样式 */
  58. .indexnewss-tools li .text span {
  59.     font-size: 12px; /* 字体大小为12px */
  60.     color: #666; /* 字体颜色为中灰色 */
  61.     display: block; /* 显示为块级元素 */
  62. }

  63. /* 按钮样式 */
  64. .indexnewss-tools li a.go {
  65.     display: inline-block; /* 显示为行内块级元素 */
  66.     padding: 8px 16px; /* 内边距为8px 16px */
  67.     background-color: #1e90ff; /* 背景色为蓝色 */
  68.     color: #fff; /* 字体颜色为白色 */
  69.     text-decoration: none; /* 移除默认的下划线 */
  70.     border-radius: 4px; /* 边框圆角为4px */
  71.     transition: background-color 0.3s; /* 背景色变化时的过渡效果 */
  72. }

  73. /* 按钮悬停样式 */
  74. .indexnewss-tools li a.go:hover {
  75.     background-color: #187bcd; /* 悬停时的背景色为深蓝色 */
  76. }
  77. </style>
  78. <div class="indexnews-tools">
  79.     <ul class="indexnewss-tools layui-clear">
  80.         <li>
  81.             <div class="content">
  82.                 <img src="https://www.jiubbs.cn/s/pic/qiandao.svg">
  83.                 <div class="text">
  84.                     <h3>签到打卡</h3>
  85.                     <span>欢迎大家每天打卡,打卡会有积分奖励哦!</span>
  86.                 </div>
  87.             </div>
  88.             <a class="go" href="/plugin.php?id=zqlj_sign" target="_blank">签到打卡</a>
  89.         </li>
  90.         <li>
  91.             <div class="content">
  92.                 <img src="https://www.jiubbs.cn/s/pic/suiji.svg">
  93.                 <div class="text">
  94.                     <h3>随机推荐</h3>
  95.                     <span>随机前往一篇帖子</span>
  96.                 </div>
  97.             </div>
  98.             <a class="go" href="/freeaddon_randomthread-freeaddon_randomthread.html" target="_blank">随便看看</a>
  99.         </li>
  100.         <li>
  101.             <div class="content">
  102.                 <img src="https://www.jiubbs.cn/s/pic/qqqun.svg">
  103.                 <div class="text">
  104.                     <h3>官方Q群</h3>
  105.                     <span>跟社区的朋友一起吹吹牛</span>
  106.                 </div>
  107.             </div>
  108.             <a class="go" href="https://qm.qq.com/q/5pWkgRfSZa" target="_blank">加入Q群</a>
  109.         </li>
  110.     </ul>
  111. </div>
复制代码
狐狸导航:https://www.foxccs.cn/
全部回复2 显示全部楼层
梦淡如非(UID:8) 发表于 2025-1-14 09:31:28 | 显示全部楼层
荷包蛋有的。中间那一条。
aoki(UID:59) 发表于 2025-1-14 20:35:01 | 显示全部楼层
梦淡如非 发表于 2025-1-14 09:31
荷包蛋有的。中间那一条。

我用html代码 补了一个CSS
狐狸导航:https://www.foxccs.cn/

快速回帖

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

1楼
2楼
3楼

关于楼主

学步前行
  • 主题

    80
  • 回答

    33
  • 积分

    363
虚位以待,此位置招租

商务推广

    此位置招租 黑粉猫影院-免费看电影 此位置招租 此位置招租 此位置招租 此位置招租 此位置招租 此位置招租 此位置招租 此位置招租
最新热评 加载中...