博客常用代码

  • 网页嵌入

    <p style="position: relative; padding: 30% 45%; text-align: left;">&nbsp;</p>
    <div style="position: relative; padding: 30% 45%;"><iframe style="position: absolute; width: 100%; height: 100%; left: 0; top: 0;" src="http://1230.la/" frameborder="no" scrolling="no" width="320" height="240"></iframe></div>

    demo

  • 音频嵌入(支持嗅探电台)

    <audio width="300" height="32" controls="controls" autoplay="autoplay"><source src="https://lhttp.qingting.fm/live/1007/64k.mp3" type="audio/mp3" /> Your browser does not support the <img src="https://common.cnblogs.com/editor/tiny_mce/themes/advanced/img/trans.gif" class="mceItemMedia mceItemAudio" width="300" height="32" data-mce-json="{'video':{'attrs':{},'sources':[]},'params':{},'video_html':' element. ','hspace':null,'vspace':null,'align':null,'bgcolor':null}" /> </audio>

    demo

  • 视频嵌入 

    <div style="position: relative; padding: 30% 45%;"><iframe style="position: absolute; width: 100%; height: 100%; left: 0; top: 0;" src="https://player.bilibili.com/player.html?aid=62035292&amp;bvid=BV19t411u7rL&amp;cid=107848905&amp;as_wide=1&amp;high_quality=1&amp;danmaku=0" frameborder="no" scrolling="no" width="320" height="240"></iframe></div>

         demo

  • 夜间模式
    script src="https://cdn.jsdelivr.net/npm/darkmode-js@1.5.7/lib/darkmode-js.min.js"></script>
    <script>
      function addDarkmodeWidget() {
        new Darkmode().showWidget();
      }
      window.addEventListener('load', addDarkmodeWidget);
    </> 

     

以上改src指向链接即可,音频嵌入还需要改格式。

posted @ 2020-09-30 11:33  依然路遥  阅读(275)  评论(0编辑  收藏  举报