代码 html一个全屏背景视频

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

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

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

推荐文章

Git 常用命令详解
2024-11-18 16:57:24 +0800 CST
curl错误代码表
2024-11-17 09:34:46 +0800 CST
Python设计模式之工厂模式详解
2024-11-19 09:36:23 +0800 CST
mysql关于在使用中的解决方法
2024-11-18 10:18:16 +0800 CST
智慧加水系统
2024-11-19 06:33:36 +0800 CST
PHP 的生成器,用过的都说好!
2024-11-18 04:43:02 +0800 CST
JavaScript设计模式:发布订阅模式
2024-11-18 01:52:39 +0800 CST
mysql时间对比
2024-11-18 14:35:19 +0800 CST
Golang Select 的使用及基本实现
2024-11-18 13:48:21 +0800 CST
Vue3 vue-office 插件实现 Word 预览
2024-11-19 02:19:34 +0800 CST
向满屏的 Import 语句说再见!
2024-11-18 12:20:51 +0800 CST
api接口怎么对接
2024-11-19 09:42:47 +0800 CST
JavaScript 策略模式
2024-11-19 07:34:29 +0800 CST
使用Python实现邮件自动化
2024-11-18 20:18:14 +0800 CST
一些好玩且实用的开源AI工具
2024-11-19 09:31:57 +0800 CST
JavaScript设计模式:桥接模式
2024-11-18 19:03:40 +0800 CST
JS中 `sleep` 方法的实现
2024-11-19 08:10:32 +0800 CST
Rust 中的所有权机制
2024-11-18 20:54:50 +0800 CST
微信内弹出提示外部浏览器打开
2024-11-18 19:26:44 +0800 CST
Go 1.23 中的新包:unique
2024-11-18 12:32:57 +0800 CST
windows下mysql使用source导入数据
2024-11-17 05:03:50 +0800 CST
Vue3中如何处理SEO优化?
2024-11-17 08:01:47 +0800 CST
服务器购买推荐
2024-11-18 23:48:02 +0800 CST
程序员茄子在线接单