博客園文章版權聲明(js自動生成)


博客園文章版權聲明(js自動生成)

一.代碼

我比較直接,直接上代碼,把下面html放右側,首頁,頁腳都可以

<style>
    #MySignature {
        display: block;
    	background-color: #c6ced4;
    	border-radius: 7px;
    	box-shadow: 1px 1px 1px #6B6B6B;
    	padding: 10px;
    	line-height: 1.5;
    	text-shadow: 1px 1px 1px #FFF;
    	font-size: 16px;
    }
    #MySignature a {
        margin: 0;
        padding: 0;
        display: contents;
    }
</style>
<script>
    var MySignature = document.querySelector('#MySignature')
    //會自動找你的url,如果你自己自定義了自定義匹配他的位置
    var postTitleUrl = document.querySelector('.postTitle a').getAttribute('href').replace(/\s*/g, "")
    //自動找你的名字,如果你自定義也是自己找
    var authorNanme = document.querySelector('#profile_block a').textContent.replace(/\s*/g, "")
    //你的介紹
    var info = '你的介紹'
    MySignature.innerHTML = '<div><p>作者:<a href=' + postTitleUrl + '>' + authorNanme + '</a></p><p>出處:<a href=' + postTitleUrl + '>' + postTitleUrl + '</a></p><p>關於作者:' + info + '</p><p>本作品采用<a rel="license" href="https://creativecommons.org/licenses/by-nc-nd/4.0/deed.zh">署名-非商業性使用-禁止演繹 4.0 國際 </a>進行許可,轉載請標明作者與出處</p></div>'
</script>


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM