代码 html一个全屏背景视频

2024-11-18 00:48:20 +0800 CST views 565

该文本是一个HTML文档,展示了一个名为“程序员茄子”的专业网站开发页面。页面包含一个全屏背景视频和中心内容,内容包括标题和描述,旨在吸引用户并提供联系链接。使用了CSS样式来设置布局、字体、动画效果和按钮样式,整体设计现代且具有视觉吸引力。

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>程序员茄子 - 专业网站开发</title>
    <style>
        /* 重置样式 */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        html, body {
            height: 100%;
            font-family: "Microsoft YaHei", sans-serif;
            overflow: hidden;
        }
        /* 背景视频样式 */
        .video-bg {
            position: fixed;
            top: 50%;
            left: 50%;
            min-width: 100%;
            min-height: 100%;
            width: auto;
            height: auto;
            z-index: -1;
            transform: translate(-50%, -50%);
            background-size: cover;
        }
        /* 内容样式 */
        .content {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            text-align: center;
            color: #fff;
            animation: fadeIn 2s ease-in-out;
        }
        .content h1 {
            font-size: 80px;
            margin-bottom: 20px;
            letter-spacing: 5px;
            text-shadow: 2px 2px 10px rgba(0,0,0,0.7);
        }
        .content p {
            font-size: 24px;
            margin-bottom: 40px;
            text-shadow: 1px 1px 5px rgba(0,0,0,0.7);
        }
        /* 按钮样式 */
        .content a {
            display: inline-block;
            padding: 15px 30px;
            font-size: 18px;
            color: #fff;
            text-decoration: none;
            border: 2px solid #fff;
            border-radius: 30px;
            transition: background 0.5s, color 0.5s;
        }
        .content a:hover {
            background: #fff;
            color: #000;
        }
        /* 进入动画 */
        @keyframes fadeIn {
            from { opacity: 0; transform: translate(-50%, -60%); }
            to { opacity: 1; transform: translate(-50%, -50%); }
        }
    </style>
</head>
<body>
    <!-- 背景视频 -->
    <video class="video-bg" autoplay muted loop>
        <source src="https://www.w3schools.com/howto/rain.mp4" type="video/mp4">
        您的浏览器不支持视频背景。
    </video>
    <!-- 内容部分 -->
    <div class="content">
        <h1>程序员茄子</h1>
        <p>专业网站开发,助您实现互联网梦想</p>
        <a href="#contact">联系我</a>
    </div>
</body>
</html>

images

复制全文 生成海报 网页设计 前端开发 用户体验

推荐文章

H5抖音商城小黄车购物系统
2024-11-19 08:04:29 +0800 CST
一键压缩图片代码
2024-11-19 00:41:25 +0800 CST
Golang 中应该知道的 defer 知识
2024-11-18 13:18:56 +0800 CST
Vue3中如何扩展VNode?
2024-11-17 19:33:18 +0800 CST
Vue3中如何处理异步操作?
2024-11-19 04:06:07 +0800 CST
Nginx负载均衡详解
2024-11-17 07:43:48 +0800 CST
PyMySQL - Python中非常有用的库
2024-11-18 14:43:28 +0800 CST
H5端向App端通信(Uniapp 必会)
2025-02-20 10:32:26 +0800 CST
PHP 如何输出带微秒的时间
2024-11-18 01:58:41 +0800 CST
初学者的 Rust Web 开发指南
2024-11-18 10:51:35 +0800 CST
Vue3中的v-for指令有什么新特性?
2024-11-18 12:34:09 +0800 CST
Rust 中的所有权机制
2024-11-18 20:54:50 +0800 CST
前端如何一次性渲染十万条数据?
2024-11-19 05:08:27 +0800 CST
【SQL注入】关于GORM的SQL注入问题
2024-11-19 06:54:57 +0800 CST
ElasticSearch简介与安装指南
2024-11-19 02:17:38 +0800 CST
MyLib5,一个Python中非常有用的库
2024-11-18 12:50:13 +0800 CST
程序员茄子在线接单