旅游登录界面

本文展示了一个使用HTML、CSS和JavaScript构建的登录界面,包括基本布局、输入验证及注册链接。
摘要由CSDN通过智能技术生成

<!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 {

        font-family: Arial, sans-serif;

        margin: 0;

        padding: 0;

        height: 100vh;

        background: #c7ecee url('your-background-image.jpg') no-repeat center center/cover;

        display: flex;

        justify-content: center;

        align-items: center;

        flex-direction: column;

    }

    .brand-text {

        color: #007bff;

        font-weight: bold;

        font-size: 50px;

        width: 60%;

        margin: auto;

        text-align: center;

        position: absolute;

        top: 10%;

        transform: translateY(-50%);

    }

    #login-box {

        background-color: #fff;

        border-radius: 8px;

        box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);

        padding: 20px;

        width: 300px;

    }

    #login-box input {

        width: 100%;

        padding: 10px;

        margin: 8px 0;

        box-sizing: border-box;

        border: 1px solid #ccc;

        border-radius: 5px;

    }

    #login-box button {

        width: 100%;

        padding: 10px;

        background-color: #007bff;

        border: none;

        border-radius: 5px;

        color: #fff;

        cursor: pointer;

    }

    #login-box button:hover {

        background-color: #0056b3;

    }

</style>

</head>

<body>

<div class="brand-text">海南旅游网</div>

<div id="login-box">

    <h2>登录</h2>

    <input type="text" id="username" placeholder="您的邮箱/手机号">

    <input type="password" id="password" placeholder="密码">

    <button οnclick="login()">登录</button>

    <div id="register-link">

        还没有账号?<a href="registration.html">立即注册</a>

    </div>

</div>

<script>

    function login() {

        var username = document.getElementById('username').value;

        var password = document.getElementById('password').value;

        if (username === "admin" && password === "admin") {

            alert("登录成功!");

        } else {

            alert("用户名或密码错误!");

        }

    }

</script>

</body>

</html>

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值