子比美化-文章顶部添加按钮样式
此页面的默认 H1 标题
代码部署
将下面的代码放到:Zibll主题设置 – 文章内页 – 文章插入内容,前后自己选
<style>
.hoayue_button_container {
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 15px;
padding: 20px 0;
width: 100%;
box-sizing: border-box;
}
.hoayue_button_block {
display: flex;
align-items: center;
justify-content: center;
padding: 8px 16px;
font-weight: 500;
border-radius: 6px;
cursor: pointer;
transition: all 0.3s ease;
color: #333;
text-align: center;
user-select: none;
background: #f2f2f2;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
border: 1px solid #ddd;
text-decoration: none;
gap: 6px;
text-decoration: none;
flex: 1 0 22%;
box-sizing: border-box;
}
.hoayue_button_block:hover {
background: #e0e0e0;
transform: translateY(-2px);
box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}
.hoayue_button_icon {
width: 18px;
height: 18px;
}
@media (min-width: 1025px) {
.hoayue_button_container {
justify-content: space-between;
}
.hoayue_button_block {
flex: 1 0 calc(25% - 20px);
max-width: 23%;
font-size: 14px;
padding: 6px 14px;
}
.hoayue_button_icon {
width: 16px;
height: 16px;
}
}
@media (min-width: 768px) and (max-width: 1024px) {
.hoayue_button_block {
flex: 1 0 calc(25% - 20px);
max-width: 23%;
font-size: 16px;
padding: 8px 16px;
}
.hoayue_button_icon {
width: 18px;
height: 18px;
}
}
@media (max-width: 767px) {
.hoayue_button_block {
flex: 1 0 calc(50% - 10px);
font-size: 14px;
padding: 8px 14px;
}
.hoayue_button_icon {
width: 16px;
height: 16px;
}
}
</style>
<div class="hoayue_button_container">
<a href="/" class="hoayue_button_block" target="_blank" rel="noopener noreferrer">
<img src="https://www.39ip.cn/" alt="加入QQ群图标" class="hoayue_button_icon" /> <!-- 图标替换为图片 -->
加入QQ群
</a>
<a href="/" class="hoayue_button_block" target="_blank" rel="noopener noreferrer">
<img src="https://www.39ip.cn/" alt="微信公众号图标" class="hoayue_button_icon" /> <!-- 图标替换为图片 -->
关注微信公众号
</a>
<a href="/" class="hoayue_button_block" target="_blank" rel="noopener noreferrer">
<img src="https://www.39ip.cn/" alt="联系我们图标" class="hoayue_button_icon" /> <!-- 联系我们图标 -->
联系我们
</a>
<a href="/" class="hoayue_button_block" target="_blank" rel="noopener noreferrer">
<img src="https://www.39ip.cn/" alt="请求更新图标" class="hoayue_button_icon" /> <!-- 图标替换为图片 -->
请求更新
</a>
</div>
提示:本文最后更新于2024年11月1日,如有错误或者已经失效,请留言告知。
THE END
不仅如此,这个看似美观的按钮可并非只是中看不中用的 “花架子”,它实际上还具有非常实用的功能。或许它可以一键直达重要的内容页面,又或者能够快速启动某种特定的交互操作,为用户带来极大的便利。如果你也被这个独特的按钮样式所吸引,对其充满了好奇与期待,那么完全可以凭借自己的能力自行进行部署哦!相信通过你的努力,一定能让这个迷人的按钮在合适的地方绽放出更加绚烂的光彩。
加入QQ群
关注微信公众号
联系我们
请求更新