在逛 Gitee、Github 等各大代碼倉庫時,往往能看到以下這種徽章式的網頁連結,美觀好看又方便,那麼這個徽章是如何製作出來的呢? 本文就帶大家製作屬於自己的徽章式連結。
效果演示

使用教學
將下面代碼放在網站底部或者側邊欄,主要是css+js的代碼! html格式!
<style>
/*底部页脚css*/
.github-badge {
display: inline-block;
border-radius: 4px;
text-shadow: none;
font-size: 12px;
color: #fff;
line-height: 15px;
background-color: #abbac3;
margin-bottom: 5px
}
.github-badge .badge-subject {
display: inline-block;
background-color: #ffa500;
padding: 4px 4px 4px 6px;
border-top-left-radius: 4px;
border-bottom-left-radius: 4px
}
.github-badge .badge-value {
display: inline-block;
padding: 4px 6px 4px 4px;
border-top-right-radius: 4px;
border-bottom-right-radius: 4px
}
.github-badge .bg-fen {
background-color: #e76dcb
}
.github-badge .bg-red {
background-color: #f55066
}
.github-badge .bg-green {
background-color: #3bca6e
}
.github-badge .bg-cai {
background-image: -webkit-linear-gradient(
0deg, #3ca5f6 0%, #a86af9 100%);
</style>
<div class="github-badge">
<span class="badge-subject">站點地圖 </span>
<a style="color:#fff" href="http://www.qqmu.com/" rel="external nofollow" target="_blank">
<span class="badge-value bg-red">Sitemap</span></a>
</div>
<div class="github-badge">
<span class="badge-subject">申請</span>
<a style="color:#fff" href="/links" rel="external nofollow" target="_blank">
<span class="badge-value bg-fen">友情鏈接</span></a>
</div>
<div class="github-badge">
<span class="badge-subject">網站運行</span>
<a style="color:#fff" href="http://www.qqmu.com/" rel="external nofollow" target="_blank">
<span class="badge-value bg-cai"><SPAN id=span_dt_dt style="color: #b5c4c3;"></SPAN> <SCRIPT language=javascript>function show_date_time(){
window.setTimeout("show_date_time()", 1000);
BirthDay=new Date("1/1/2024 23:32:13");
today=new Date();
timeold=(today.getTime()-BirthDay.getTime());
sectimeold=timeold/1000
secondsold=Math.floor(sectimeold);
msPerDay=24*60*60*1000
e_daysold=timeold/msPerDay
daysold=Math.floor(e_daysold);
e_hrsold=(e_daysold-daysold)*24;
hrsold=Math.floor(e_hrsold);
e_minsold=(e_hrsold-hrsold)*60;
minsold=Math.floor((e_hrsold-hrsold)*60);
seconds=Math.floor((e_minsold-minsold)*60);
span_dt_dt.innerHTML='<font style=color:#00ffff>'+daysold+' 天</font> <font style=color:#00ffff>'+hrsold+' 时</font> <font style=color:#00ffff>'+minsold+' 分</font> <font style=color:#00ffff>'+seconds+' 秒</font>';
}
show_date_time();</script></span></a>
</div>
文章標題:網站底部美化代碼 支援任意網站
本文鏈接:https://angelal.cc/1646.html
文章版權:除非特別註明,否則均為AngelaL的原創文章,轉載必須以鏈接形式標明本文鏈接
本文最後更新發佈於:2025年03月06日 02:15, 某些文章具有時效性,若有錯誤或已失效,請在下方留言。