圖標(biāo)式和文字式按鈕可以自定義出現(xiàn)的圖標(biāo),比如說對(duì)于以下圖標(biāo)式按鈕的代碼:
<!-- Baidu Button BEGIN --> <div id="bdshare" class="bdshare_t bds_tools get-codes-bdshare"> <a class="bds_qzone"></a> <a class="bds_tsina"></a> <a class="bds_tqq"></a> <a class="bds_renren"></a> <span class="bds_more">更多</span> </div> <script type="text/javascript" id="bdshare_js" data="type=tools" ></script> <script type="text/javascript" id="bdshell_js"></script> <script type="text/javascript"> document.getElementById("bdshell_js").src = "http://bdimg.share.baidu.com/static/js/shell_v2.js?cdnversion=" + Math.ceil(new Date()/3600000); </script> <!-- Baidu Button END -->
生成的百度分享按鈕為:
上述代碼中,我們只需要關(guān)注HTML代碼部分。其中有4個(gè)<a>標(biāo)簽,它們的class名稱的后綴分別為qzone、tsina、tqq與renren,分別代表QQ空間、新浪微博、騰訊微博和人人網(wǎng)。<a>標(biāo)簽的順序決定了圖標(biāo)的順序。如果我們想要增加一個(gè)分享到開心網(wǎng)的按鈕,只需要在適當(dāng)?shù)奈恢貌迦胍粋€(gè)<a class=”bds_kaixin001”></a>標(biāo)簽就可以了,如:
<!-- Baidu Button BEGIN --> <div id="bdshare" class="bdshare_t bds_tools get-codes-bdshare"> <a class="bds_qzone"></a> <a class="bds_kaixin001"></a> <a class="bds_tsina"></a> <a class="bds_tqq"></a> <a class="bds_renren"></a> //在這里加入新的a標(biāo)簽即可 <span class="bds_more">更多</span> </div> <script type="text/javascript" id="bdshare_js" data="type=tools" ></script> <script type="text/javascript" id="bdshell_js"></script> <script type="text/javascript"> document.getElementById("bdshell_js").src = "http://bdimg.share.baidu.com/static/js/shell_v2.js?cdnversion=" + Math.ceil(new Date()/3600000); </script> <!-- Baidu Button END -->
生成的百度分享按鈕就變成了:
更多建議: