帮我用html css写段代码 能够播放视频的 背景要紫色 标题是演唱会 最好有透明度 高级一点
时间: 2024-03-17 18:42:23 浏览: 157
好的,以下是一个简单的 HTML/CSS 代码,带有紫色背景、标题、透明度以及视频播放器。你可以根据自己的需要进行修改和美化。
<!DOCTYPE html>
<html>
<head>
<title>演唱会</title>
<style>
body {
background-color: rgba(153, 50, 204, 0.5); /* 紫色背景,带有透明度 */
margin: 0;
padding: 0;
}
h1 {
color: #fff; /* 白色标题 */
font-size: 3rem;
text-align: center;
margin-top: 50px;
text-shadow: 2px 2px 4px rgba(0,0,0,0.5); /* 标题带有阴影效果 */
}
.video-container {
position: relative;
padding-bottom: 56.25%;
height: 0;
overflow: hidden;
}
.video-container iframe,
.video-container object,
.video-container embed {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<h1>演唱会</h1>
<div class="video-container">
<iframe width="560" height="315" src="https://www.youtube.com/embed/VIDEO_ID" frameborder="0" allowfullscreen></iframe> <!-- 替换 VIDEO_ID 为你要播放的视频的 ID -->
</div>
</body>
</html>
希望可以帮到你!
相关推荐















