如何编写一个简洁的HTML登录界面源码?

如何编写一个简洁的HTML登录界面源码?

这段摘要将介绍登录界面HTML源码,包括页面结构、输入框、按钮和表单验证等关键元素。
<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF8">
    <meta name="viewport" content="width=devicewidth, initialscale=1.0">
    <title>登录界面</title>
    <style>
        body {
            fontfamily: Arial, sansserif;
            backgroundcolor: #f0f0f0;
            display: flex;
            justifycontent: center;
            alignitems: center;
            height: 100vh;
            margin: 0;
        }
        .logincontainer {
            backgroundcolor: #ffffff;
            borderradius: 5px;
            boxshadow: 0 2px 5px rgba(0, 0, 0, 0.1);
            width: 400px;
            padding: 20px;
        }
        h1 {
            textalign: center;
            marginbottom: 20px;
        }
        input[type="text"], input[type="password"] {
            width: 100%;
            padding: 10px;
            marginbottom: 10px;
            border: 1px solid #ccc;
            borderradius: 3px;
        }
        button {
            width: 100%;
            padding: 10px;
            backgroundcolor: #007bff;
            color: #ffffff;
            border: none;
            borderradius: 3px;
            cursor: pointer;
        }
        button:hover {
            backgroundcolor: #0056b3;
        }
    </style>
</head>
<body>
    <div class="logincontainer">
        <h1>登录</h1>
        <form>
            <label for="username">用户名:</label>
            <input type="text" id="username" name="username" required>
            <label for="password">密码:</label>
            <input type="password" id="password" name="password" required>
            <button type="submit">登录</button>
        </form>
    </div>
</body>
</html>

以上就是关于“登录界面html源码”的问题,朋友们可以点击主页了解更多内容,希望可以够帮助大家!

如何编写一个简洁的HTML登录界面源码?

原创文章,作者:未希,如若转载,请注明出处:https://www.kdun.com/ask/1088822.html

(0)
未希的头像未希新媒体运营
上一篇 2024-09-26 13:06
下一篇 2024-09-26 13:09

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注

云产品限时秒杀。精选云产品高防服务器,20M大带宽限量抢购  >>点击进入