代码 html一个全屏背景视频

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

该文本是一个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

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

推荐文章

支付宝批量转账
2024-11-18 20:26:17 +0800 CST
pip安装到指定目录上
2024-11-17 16:17:25 +0800 CST
SQL常用优化的技巧
2024-11-18 15:56:06 +0800 CST
Golang Select 的使用及基本实现
2024-11-18 13:48:21 +0800 CST
Roop是一款免费开源的AI换脸工具
2024-11-19 08:31:01 +0800 CST
JavaScript设计模式:桥接模式
2024-11-18 19:03:40 +0800 CST
GROMACS:一个美轮美奂的C++库
2024-11-18 19:43:29 +0800 CST
Nginx 如何防止 DDoS 攻击
2024-11-18 21:51:48 +0800 CST
纯CSS实现3D云动画效果
2024-11-18 18:48:05 +0800 CST
智慧加水系统
2024-11-19 06:33:36 +0800 CST
PHP openssl 生成公私钥匙
2024-11-17 05:00:37 +0800 CST
mysql时间对比
2024-11-18 14:35:19 +0800 CST
2025年,小程序开发到底多少钱?
2025-01-20 10:59:05 +0800 CST
详解 Nginx 的 `sub_filter` 指令
2024-11-19 02:09:49 +0800 CST
CSS Grid 和 Flexbox 的主要区别
2024-11-18 23:09:50 +0800 CST
Vue 中如何处理跨组件通信?
2024-11-17 15:59:54 +0800 CST
Vue 3 中的 Fragments 是什么?
2024-11-17 17:05:46 +0800 CST
Rust 高性能 XML 读写库
2024-11-19 07:50:32 +0800 CST
filecmp,一个Python中非常有用的库
2024-11-19 03:23:11 +0800 CST
程序员茄子在线接单