返回列表 发布新帖
查看: 82|回复: 0

[代码技巧] 子比主题 – 文章顶部添加按钮样式

[复制链接]
SunJu_FaceMall
社区贡献

315

主题

190

回帖

1万

积分

等级头衔
Icon组别 : 管理员
Icon等级 :

积分成就
   钻石 : 524 颗
   贡献 : 1849 点
   金币 : 12 枚
Icon在线时间 : 1298 小时
Icon注册时间 : 2024-11-22
Icon最后登录 : 2025-12-12

荣誉勋章

会员LV.1会员LV.2会员LV.3会员LV.4会员LV.5会员LV.6会员LV.7会员LV.8会员LV.9会员LV.10

风云·优秀版主

飞流名人堂成员

1

实名认证 手机认证 vip vip-year FLLTCN发表于 2025-10-8 22:23:17 | 查看全部 |阅读模式 浙江金华

资源无需等待,交易就趁现在,全面资源整合网络大咖云集,让你轻松玩转互联网!

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

×
这是一款文章顶部添加按钮样式,当用户访问文章的时候可以看到这四个按钮,按钮的样式也非常简约,这个按钮也非常的实用,喜欢的自行部署!

image.webp

代码部署


将下面的代码放到:子比主题–>>文章&列表–>>文章页面–>>文章插入内容(前后自己选择吧)
  1. <style>
  2.     .hoayue_button_container {
  3.         display: flex;
  4.         flex-wrap: wrap;
  5.         justify-content: center;
  6.         gap: 15px;
  7.         padding: 20px 0;
  8.         width: 100%;
  9.         box-sizing: border-box;
  10.     }

  11.     .hoayue_button_block {
  12.         display: flex;
  13.         align-items: center;
  14.         justify-content: center;
  15.         padding: 8px 16px;
  16.         font-weight: 500;
  17.         border-radius: 6px;
  18.         cursor: pointer;
  19.         transition: all 0.3s ease;
  20.         color: #333;
  21.         text-align: center;
  22.         user-select: none;
  23.         background: #f2f2f2;
  24.         box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  25.         border: 1px solid #ddd;
  26.         text-decoration: none;
  27.         gap: 6px;
  28.         text-decoration: none;
  29.         flex: 1 0 22%;
  30.         box-sizing: border-box;
  31.     }

  32.     .hoayue_button_block:hover {
  33.         background: #e0e0e0;
  34.         transform: translateY(-2px);
  35.         box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
  36.     }

  37.     .hoayue_button_icon {
  38.         width: 18px;
  39.         height: 18px;
  40.     }

  41.     @media (min-width: 1025px) {
  42.         .hoayue_button_container {
  43.             justify-content: space-between;
  44.         }
  45.         .hoayue_button_block {
  46.             flex: 1 0 calc(25% - 20px);
  47.             max-width: 23%;
  48.             font-size: 14px;
  49.             padding: 6px 14px;
  50.         }
  51.         .hoayue_button_icon {
  52.             width: 16px;
  53.             height: 16px;
  54.         }
  55.     }

  56.     @media (min-width: 768px) and (max-width: 1024px) {
  57.         .hoayue_button_block {
  58.             flex: 1 0 calc(25% - 20px);
  59.             max-width: 23%;
  60.             font-size: 16px;
  61.             padding: 8px 16px;
  62.         }
  63.         .hoayue_button_icon {
  64.             width: 18px;
  65.             height: 18px;
  66.         }
  67.     }

  68.     @media (max-width: 767px) {
  69.         .hoayue_button_block {
  70.             flex: 1 0 calc(50% - 10px);
  71.             font-size: 14px;
  72.             padding: 8px 14px;
  73.         }
  74.         .hoayue_button_icon {
  75.             width: 16px;
  76.             height: 16px;
  77.         }
  78.     }
  79. </style>
  80. <div class="hoayue_button_container">
  81.    
  82.     <a href="/" class="hoayue_button_block" target="_blank" rel="noopener noreferrer">
  83.          <!-- 图标替换为图片 -->
  84.         加入QQ群
  85.     </a>
  86.     <a href="/" class="hoayue_button_block" target="_blank" rel="noopener noreferrer">
  87.          <!-- 图标替换为图片 -->
  88.         关注微信公众号
  89.     </a>
  90.     <a href="/" class="hoayue_button_block" target="_blank" rel="noopener noreferrer">
  91.          <!-- 联系我们图标 -->
  92.         联系我们
  93.     </a>
  94.     <a href="/" class="hoayue_button_block" target="_blank" rel="noopener noreferrer">
  95.          <!-- 图标替换为图片 -->
  96.         请求更新
  97.     </a>
  98. </div>
复制代码


本帖被以下淘专辑推荐:

路虽远,行则将至;事虽难,做则必成。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

飞流广播+ 发布

系统消息:柒沐已经连续答对3道难题,逆天学霸谁与争锋?!#每日答题#
10-30 17:02
系统消息:柒沐已经连续答对10道难题,逆天学霸谁与争锋?!#每日答题#
10-09 09:07
系统消息:柒沐已经连续答对3道难题,逆天学霸谁与争锋?!#每日答题#
09-24 09:00
系统消息:柒沐已经连续答对3道难题,逆天学霸谁与争锋?!#每日答题#
09-11 11:40
系统消息:柒沐已经连续答对3道难题,逆天学霸谁与争锋?!#每日答题#
09-02 09:17
系统消息:柒沐已经连续答对3道难题,逆天学霸谁与争锋?!#每日答题#
08-27 08:56
系统消息:柒沐已经连续答对3道难题,逆天学霸谁与争锋?!#每日答题#
08-20 15:12
系统消息:柒沐已经连续答对3道难题,逆天学霸谁与争锋?!#每日答题#
08-03 10:22
系统消息:柒沐已经连续答对10道难题,逆天学霸谁与争锋?!#每日答题#
06-30 08:57
系统消息:柒沐已经连续答对3道难题,逆天学霸谁与争锋?!#每日答题#
06-18 09:14
系统消息:清风网络已经连续答对10道难题,逆天学霸谁与争锋?!#每日答题#
04-11 09:40
系统消息:清风网络已经连续答对3道难题,逆天学霸谁与争锋?!#每日答题#
04-10 09:31
系统消息:IXM77777已经连续答对3道难题,逆天学霸谁与争锋?!#每日答题#
04-09 13:44
系统消息:清风网络已经连续答对3道难题,逆天学霸谁与争锋?!#每日答题#
04-09 09:22
系统消息:柒沐已经连续答对10道难题,逆天学霸谁与争锋?!#每日答题#
04-09 08:52
系统消息:清风网络已经连续答对3道难题,逆天学霸谁与争锋?!#每日答题#
04-08 09:24
系统消息:柒沐已经连续答对3道难题,逆天学霸谁与争锋?!#每日答题#
04-07 09:02
系统消息:柒沐已经连续答对10道难题,逆天学霸谁与争锋?!#每日答题#
02-27 09:35
系统消息:柒沐已经连续答对3道难题,逆天学霸谁与争锋?!#每日答题#
02-26 09:06
系统消息:柒沐已经连续答对3道难题,逆天学霸谁与争锋?!#每日答题#
02-25 08:49
站内通告

提供资源交易、信息共享、靓号交流、技术变现、学习问答、兴趣娱乐等全面服务。

1.丰富功能系统,扩展社区特色玩法,打造最好的互联网聚集圈子。

2.准确信息真实交易,安全快捷又方便,让虚拟交易面对面。

3. 天上不会掉馅饼,话术骗术迷人心,切勿脱离平台线下交易,被骗与平台无关!

4. 欺诈骗钱,违规违法将视情受到警告&禁言&封号甚至检举至👮🏻‍♀️处理!

官方Q群:123129钉推群:BAYR2383 站长QQ:3220000000

投诉/建议/商务合作联系

fl@fllt.cn

严禁私下交易,被骗与本站无关。
违反交易细则,取证立查严惩。
  • 钉钉新帖推送群
  • 官方交流QQ群
  • 站长唯一微信号

👮曝光Ta|🧿小黑屋|📴手机页|飞流网 ( 渝ICP备2025054677号-1|电信增值许可 渝B2-20250789 )|网站地图

GMT+8, 2025-12-14 06:45 , Processed in 0.083291 second(s), 62 queries, MemCached On , Gzip On.

Based on XJ-TX X3.5 Licensed

飞流论坛 HanAnalytics icp Astro vhAstro-Theme

关灯 在本版发帖
扫一扫添加微信客服
QQ客服返回顶部
快速回复 返回顶部 返回列表