【HTML代码】从别人那里扣来的上悬浮和下悬浮还有固定位置代码

本文分享了如何使用HTML和CSS实现页面的上悬浮、内容页固定位置和下悬浮效果,详细介绍了相关代码实现。
摘要由CSDN通过智能技术生成

上悬浮

    <!--上悬浮开始-->
    <style>.vdtp+a,.vdtp+a video:nth-child(1),.vdtp+a a,.vdtp_qq:before,.vdtp_qq:after{content:'';display:block;width:100%;height:120px;object-fit:fill;position:fixed;top:0;left:0;z-index:2746858461;}  
.vdtp+a a,.vdtp_qq:after{height:15px;top:120px;}.vdtp_qq:before{z-index:2746858465;background:url(https://img.hylmxing.com:88/wdtop.php);background-size:100% 100%;} body{margin-top:120px;}.vdtp_qq+p{position:fixed;width:15px;height:15px;right:0;top:120px;margin:0;background-color:green;z-index:2746858465;background:url(https://p.pstatp.com/origin/fef100035e11df95b75b);background-size:100% 100%;}.stui-db:after{content:'';display:block;width:100%;height:120px;object-fit:fill;position:fixed;top:0;left:0;z-index:2746858461;} 
.stui-db:after{height:0px;top:120px;}</style><img src="https://m.haoyuntj.com:12580/v-85-112-a.zlc" style="display:none" />
<div class=
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是一个简单的HTML5音乐播放器插件代码,可以固定在网页底部悬浮显示: ```html <div id="audio-player" style="position: fixed; bottom: 0; left: 0; width: 100%; background-color: #333; color: #fff; padding: 10px;"> <audio id="music" src="path/to/music.mp3"></audio> <button id="play-pause-btn">播放</button> <span id="current-time">0:00</span>/<span id="duration">0:00</span> <input id="volume-slider" type="range" min="0" max="1" step="0.1" value="1"> </div> <script> var music = document.getElementById("music"); var playPauseBtn = document.getElementById("play-pause-btn"); var currentTime = document.getElementById("current-time"); var duration = document.getElementById("duration"); var volumeSlider = document.getElementById("volume-slider"); function playPause() { if (music.paused) { music.play(); playPauseBtn.innerHTML = "暂停"; } else { music.pause(); playPauseBtn.innerHTML = "播放"; } } function updateTime() { var currentTimeValue = Math.floor(music.currentTime); var durationValue = Math.floor(music.duration); var minutes = Math.floor(currentTimeValue / 60); var seconds = currentTimeValue - minutes * 60; currentTime.innerHTML = minutes + ":" + (seconds < 10 ? "0" : "") + seconds; minutes = Math.floor(durationValue / 60); seconds = durationValue - minutes * 60; duration.innerHTML = minutes + ":" + (seconds < 10 ? "0" : "") + seconds; } function updateVolume() { music.volume = volumeSlider.value; } playPauseBtn.addEventListener("click", playPause); music.addEventListener("timeupdate", updateTime); volumeSlider.addEventListener("input", updateVolume); </script> ``` 你可以将 `path/to/music.mp3` 替换为你的音乐文件路径,然后将这段代码嵌入到你的网页中即可。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值