<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <title>趣味声音与背景图片</title> <style> body { margin: 0; padding: 0; display: flex; justify-content: center; align-items: center; height: 100vh; background-image: url('background.jpg'); background-size: cover; background-position: center; background-repeat: no-repeat; } h1 { text-align: center; color: white; font-size: 2em; } audio { display: none; } </style> </head> <body onload="playSound()"> <h1>欢迎来到我的趣味页面</h1> <audio id="funnySound" src="sound.mp3" preload="auto"></audio> <script> function playSound() { var sound = document.getElementById('funnySound'); sound.play(); } </script> </body> </html>