zoukankan      html  css  js  c++  java
  • 博客园文章版权声明(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>
    
  • 相关阅读:
    前端从头再出发之表单
    百度前端学院第19天作业
    百度前端学院第17到18天和第16天的作业
    百度前端学院第九天到第11天笔记
    自己爬虫的几个案例
    Magnum Kubernetes源码分析(一)
    magnum devstack部署
    kubernetes service分析
    玩转docker镜像和镜像构建
    Dockerfile与Docker构建流程解读
  • 原文地址:https://www.cnblogs.com/pythonywy/p/12219094.html
Copyright © 2011-2022 走看看