传奇整合版link.htm背景图片音乐与滚动文字代码配置指南

来源: 作者: 点击:
一、 完整代码模板

将以下代码直接复制并覆盖原有的link.htm文件内容。代码中已包含背景图片设置、背景音乐自动循环播放,以及支持鼠标悬停暂停的滚动公告。

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>登录器公告</title>
<style>
/* 设置背景图片,确保铺满且不重复 */
body {
background-image: url('bg.jpg'); /* 替换为你的背景图片文件名 */
background-repeat: no-repeat;
background-size: cover;
background-attachment: fixed;
margin: 0;
padding: 0;
overflow: hidden; /* 隐藏滚动条 */
}
/* 滚动文字区域样式 */
.notice-area {
position: absolute;
bottom: 20px; /* 距离底部的距离 */
width: 100%;
text-align: center;
}
marquee {
color: #FF0000; /* 文字颜色 */
font-size: 16px; /* 文字大小 */
font-weight: bold; /* 文字加粗 */
font-family: "微软雅黑", sans-serif;
}
</style>
</head>
<body>

<!-- 背景音乐设置:自动播放并循环 -->
<audio src="bgm.mp3" autoplay="autoplay" loop="loop" preload="auto"></audio>
<!-- 兼容老旧内核的备用音乐代码 -->
<bgsound src="bgm.mp3" loop="-1">

<!-- 滚动公告区域 -->
<div class="notice-area">
<marquee direction="left" scrollamount="3" behavior="scroll" onmouseover="this.stop()" onmouseout="this.start()">
欢迎体验全新版本,特色玩法等你探索! | 每日准时开启活动,详情请关注游戏内提示。
</marquee>
</div>

</body>
</html>


二、 文件准备与部署步骤

准备素材文件
在Link文件夹中,必须准备好名为bg.jpg的背景图片和名为bgm.mp3的背景音乐文件。如果使用的文件名不同,需在上述代码的url('bg.jpg')和src="bgm.mp3"处进行同步修改。
替换网页文件
将修改好的完整代码保存为link.htm文件,并放入网站根目录,替换掉原有的旧文件。
重启验证效果
彻底关闭登录器进程后重新打开。此时公告窗口应能正常显示设定的背景图,自动播放背景音乐,并在底部展示红色的滚动公告。将鼠标悬停在公告文字上时,文字会暂停滚动以便阅读,移开鼠标后继续滚动。