圊圊淥詶 发表于 2026-6-30 20:53:19

【代码交流】音画永久居中代码

<BR><BR>
这个代码是苦于论坛几次更换模板,都会偏移尺寸的问题后而来,每次更换模板后都会发现本来居中的音画又偏移了。<BR><BR>

现在我们的会员都是在几个论坛玩,每个论坛的页面尺寸都不一样,所以每次发图都要重新调整。<BR><BR>

终于这次下定决心,突破这个障碍,算是个小小的福利,大家以后再也不用为每次都来调整自己的尺寸而伤脑筋了,不管什么模板,不管哪个论坛,不管自己的图片是什么尺寸,你都不用管了,照着贴出来的这个代码,你直接更换图片、更换音乐、更换动画即可,什么都不用管了,是不是很爽?(已经亲测多个论坛,有效!)<BR><BR>

这个代码是根据花静简、贪心的鱼、青依她们三人的代码组合而成,在此谢谢她们~~
<BR><BR><BR>




圊圊淥詶 发表于 2026-6-30 20:53:20

<div style="Z-INDEX: 32768; POSITION: absolute; MARGIN-TOP: 135px; WIDTH: 100%; LEFT: 0px; overflow: hidden;">
<div style="display: flex; justify-content: center; width: 100%;">
<div style="max-width: 100%; position: relative; overflow: hidden;">
<img src="https://www.yhyhlt.com/data/attachment/forum/202606/30/201641u8tt9cau7phxzv9z.jpg" style="width: 100%; display: block; height: auto;" />
<video autoplay loop muted playsinline style="position: absolute; top: 50%; left: 50%; width: 110%; height: 110%; transform: translate(-50%, -50%) scale(1.05); object-fit: cover; mix-blend-mode: screen; opacity: 0.21; pointer-events: none; z-index: 10;">
<source src="https://yw83yw.oss-cn-hangzhou.aliyuncs.com/lvzhou/flash/MP4/DH04.mp4" type="video/mp4">
</video>
</div>
</div>
</div>
<div style="HEIGHT: 1000px"></div>
<br><br><br><br><br><br><br><br><br>


这一组是图片背景平底代码:<br>
<div style="Z-INDEX: 32768; POSITION: absolute; MARGIN-TOP: 135px; WIDTH: 100%; LEFT: 0px; overflow: hidden;">
<div style="display: flex; justify-content: center; width: 100%;">
<div style="max-width: 100%; position: relative; overflow: hidden;">
/* 以下代码更换图片链接 */
<img src="https://www.yhyhlt.com/data/attachment/forum/202606/30/201641u8tt9cau7phxzv9z.jpg" style="width: 100%; display: block; height: auto;" />
<video autoplay loop muted playsinline style="position: absolute; top: 50%; left: 50%; width: 110%; height: 110%; transform: translate(-50%, -50%) scale(1.05); object-fit: cover; mix-blend-mode: screen; opacity: 0.21; pointer-events: none; z-index: 10;">
/* 以下代码更换动画链接 */
<source src="https://yw83yw.oss-cn-hangzhou.aliyuncs.com/lvzhou/flash/MP4/DH04.mp4" type="video/mp4">
</video>
</div>
</div>
</div>
<div style="HEIGHT: 1000px"></div>
<br><br><br><br><br><br><br><br><br>

圊圊淥詶 发表于 2026-6-30 20:53:21

<div style="Z-INDEX: 32768; POSITION: absolute; MARGIN-TOP: 135px; WIDTH: 100%; LEFT: 0px; overflow: hidden;">
<div style="display: flex; justify-content: center; width: 100%; padding: 30px 0; box-sizing: border-box;">
<div style="max-width: 100%; position: relative; box-shadow: 3px 3px 20px #000; overflow: hidden;">
<img src="https://www.yhyhlt.com/data/attachment/forum/202606/30/201641u8tt9cau7phxzv9z.jpg" style="width: 100%; display: block; height: auto;" />
<video autoplay loop muted playsinline style="position: absolute; top: 50%; left: 50%; width: 120%; height: 120%; transform: translate(-50%, -50%) scale(0.86); object-fit: cover; mix-blend-mode: screen; opacity: 0.21; pointer-events: none; z-index: 10;">
<source src="https://yw83yw.oss-cn-hangzhou.aliyuncs.com/lvzhou/flash/MP4/DH04.mp4" type="video/mp4">
</video>
</div>
</div>
</div>
<div style="HEIGHT: 1000px"></div>
<br><br><br><br><br><br><br><br><br>



这一组是图片背景有投影的代码:<br>
<div style="Z-INDEX: 32768; POSITION: absolute; MARGIN-TOP: 135px; WIDTH: 100%; LEFT: 0px; overflow: hidden;">
<div style="display: flex; justify-content: center; width: 100%; padding: 30px 0; box-sizing: border-box;">
<div style="max-width: 100%; position: relative; box-shadow: 3px 3px 20px #000; overflow: hidden;">
/* 以下代码更换图片链接 */
<img src="https://www.yhyhlt.com/data/attachment/forum/202606/30/201641u8tt9cau7phxzv9z.jpg" style="width: 100%; display: block; height: auto;" />
<video autoplay loop muted playsinline style="position: absolute; top: 50%; left: 50%; width: 120%; height: 120%; transform: translate(-50%, -50%) scale(0.86); object-fit: cover; mix-blend-mode: screen; opacity: 0.21; pointer-events: none; z-index: 10;">
/* 以下代码更换动画链接 */
<source src="https://yw83yw.oss-cn-hangzhou.aliyuncs.com/lvzhou/flash/MP4/DH04.mp4" type="video/mp4">
</video>
</div>
</div>
</div>
<div style="HEIGHT: 1000px"></div>
<br><br><br><br><br><br><br><br><br>

圊圊淥詶 发表于 2026-6-30 20:53:22

<BR><BR>
这2组代码希望能给大家带来方便,有什么意见也可以给绿洲提出来,愿大家玩图开心哈~~<BR>
大家一起听个蛐蛐吧,很好听的一首蛐蛐,配上面鱼师的素挺合适{:1_233:} ~~
<BR><BR>

<audio style="width: 300px; height: 60px;" src="https://www.joy127.com/url/154409.mp3" autoplay="autoplay" loop="loop" controls="controls" type="audio/mpeg"></audio>
<BR>
歌       曲:身边有你已足够<BR>
歌       手:花见铃<BR>
(七月同图推荐歌曲)
<BR><BR>

玫の玫 发表于 2026-6-30 20:53:52

破帅好银 ~~为人民服务{:S06:}

玫の玫 发表于 2026-6-30 20:55:09

音画永久居中代码~以后就用破帅这个省事了~{:9_269:}

楚云飞 发表于 2026-6-30 20:59:39

不错啊,这样就不用来回调整叻,非常给力~~
{:10_295:}

楚云飞 发表于 2026-6-30 21:05:36

下次发布帖子,必须要测试一下,破帅辛苦哈~

玫の玫 发表于 2026-6-30 21:13:19

奖励破帅上个小吊挂~~

呼吸 发表于 2026-6-30 21:15:47

音画永久居中代码真不错谢谢淥詶帅弟分享 辛苦了哈!{:1_150:}
页: [1] 2
查看完整版本: 【代码交流】音画永久居中代码