我比较直接,直接上代码,把下面html放右侧,首页,页脚均可以
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>