模拟三张网页练习(登录页,主页,浏览页)

登录页

代码:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Ecommerce Login</title>
    <link rel="stylesheet" href="styles.css">
    <style>
body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    background: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-image: url("微信图片_20240720110113.png"); 
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-size: cover; 
}
.login-container {
    width: 300px;
    padding: 20px;
    background: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    background-color: rgba(255, 255, 255, 0.5);
    background-image: url('');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.login-container h1 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
}

.login-container form {
    display: flex;
    flex-direction: column;
}

.login-container form input {
    margin-bottom: 15px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    outline: none;
}

.login-container form button {
    padding: 10px;
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.login-container form button:hover {
    background: #0056b3;
}

.register-link {
    text-align: center;
    margin-top: 20px;
}

.register-link a {
    color: #007bff;
    text-decoration: none;
}

.register-link a:hover {
    text-decoration: underline;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

</style>
</head>
<body>
    <div class="login-container">
        <h1>欢迎登录</h1>
        <form id="login-form">
            <input type="email" placeholder="账号" required>
            <input type="password" placeholder="密码" required>
            <button type="submit">登录</button>
        </form>
        <div class="register-link">
            <p>你没有旧账号? <a href="#">点击注册</a></p>
        </div>
    </div>
</body>
</html>

运行截图:

主页

代码:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Video Background with Navigation Bar Example</title>
    <style>
        body {
            margin: 0;
            padding: 0;
            background-color: #000;
        }

        .video-background {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            overflow: hidden;
            z-index: -1;
        }

        .content {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            text-align: center;
            color: white;
            font-size: 24px;
        }
        .navbar {
            background: linear-gradient(to right, rgb(100, 3, 3), rgba(231, 28, 28, 0.537));
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            background-color: rgba(0, 0, 0, 0.7);
            padding: 20px;
            z-index: 1;
        }

        .navbar a {
            color: white;
            text-decoration: none;
            margin-right: 20px;
        }

        .navbar a:hover {
            color: red;
        }
    </style>
</head>
<body>
    <div class="video-background">
        <video autoplay muted loop>
            <source src="./屏幕录制 2024-07-20 105544.mp4" type="video/mp4">
            Your browser does not support the video tag.
        </video>
    </div>
    <div class="navbar">
        <a href="#">首页</a>
        <a href="#">周年庆</a>
        <a href="#">藏宝阁</a>
        <a href="#">云·永劫</a>
        <a href="#">赛事中心</a>
        <a href="#">世界观资料库</a>
        <a href="#">专题站</a>
        <a href="#">游戏下载</a>
        <a href="#">新闻公告</a>
        <a href="#">手游下载</a>
    </div>
    </div>
</body>
</html>

运行截图:

浏览页

代码:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title></title>
    <style>
        body {
            margin: 0;
            padding: 0;
            background-color: #000;
        }

        body {
            font-family: 'Arial', sans-serif;
            margin: 0;
            padding: 0;
            background: #f0f0f0;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;   
          }
        .content {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            text-align: center;
            color: white;
            font-size: 24px;
        }
        .navbar {
            background: linear-gradient(to right, rgb(100, 3, 3), rgba(231, 28, 28, 0.537));
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            background-color: rgba(0, 0, 0, 0.7);
            padding: 20px;
            z-index: 1;
        }

        .navbar a {
            color: white;
            text-decoration: none;
            margin-right: 20px;
        }

        .navbar a:hover {
            color: red;
        }
        .haha {
            font-size: 24px; 
            font-weight: bold; 
        }
        .background-container {
            position: relative;
        }

    </style>
</head>
<body>
    <div class="background-container">
        <img src="./微信图片_20240720112123.png" alt="Background Image">
    </div>    
    <div class="navbar">
        <a href="#">首页</a>
        <a href="#">周年庆</a>
        <a href="#">藏宝阁</a>
        <a href="#">云·永劫</a>
        <a href="#">赛事中心</a>
        <a href="#">世界观资料库</a>
        <a href="#">专题站</a>
        <a href="#" class="haha">游戏下载</a>
        <a href="#">新闻公告</a>
        <a href="#">手游下载</a>
    </div>
    </div>
</body>
</html>

运行截图:

  • 3
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值