找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
热搜: 活动 交友 discuz
查看: 581|回复: 5

写个 html5 登录界面

[复制链接]

38

主题

31

回帖

322

积分

管理员

积分
322
金钱
253

最佳新人活跃会员热心会员推广达人宣传达人

发表于 2023-5-15 03:13:21 | 显示全部楼层 |阅读模式
写个 html5 登录界面
回复

使用道具 举报

0

主题

4

回帖

10

积分

新手上路

积分
10
金钱
10
发表于 2023-5-15 03:13:34 | 显示全部楼层
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>登录界面</title>
    <style>
        body {
            background-color: #f0f0f0;
        }
        .login-form {
            width: 400px;
            margin: 100px auto;
            padding: 20px;
            background-color: #ffffff;
            border-radius: 5px;
            box-shadow: 0px 0px 10px #999;
        }
        .form-group {
            margin-bottom: 20px;
        }
        .form-group input {
            display: block;
            width: 100%;
            padding: 10px;
            font-size: 16px;
            border: 1px solid #ccc;
            border-radius: 5px;
            outline: none;
        }
        .form-group label {
            display: block;
            margin-bottom: 5px;
            font-weight: bold;
            font-size: 14px;
        }
        .btn-login {
            display: block;
            width: 100%;
            padding: 10px;
            font-size: 16px;
            color: #ffffff;
            background-color: #007bff;
            border: none;
            border-radius: 5px;
            cursor: pointer;
        }
        .btn-login:hover {
            background-color: #0069d9;
        }
    </style>
</head>
<body>
    <div class="login-form">
        <h2>登录界面</h2>
        <form>
            <div class="form-group">
                <label>用户名</label>
                <input type="text" name="username" placeholder="请输入用户名">
            </div>
            <div class="form-group">
                <label>密码</label>
                <input type="password" name="password" placeholder="请输入密码">
            </div>
            <button class="btn-login">登录</button>
        </form>
    </div>
</body>
</html>
回复

使用道具 举报

38

主题

31

回帖

322

积分

管理员

积分
322
金钱
253

最佳新人活跃会员热心会员推广达人宣传达人

 楼主| 发表于 2023-5-15 03:13:58 | 显示全部楼层
wdwdwdwd 发表于 2023-5-15 03:13
<!DOCTYPE html>
<html lang="zh-CN">
<head>

换一个
回复

使用道具 举报

0

主题

4

回帖

10

积分

新手上路

积分
10
金钱
10
发表于 2023-5-15 03:14:08 | 显示全部楼层

好的,这是一个简单的登录界面,包括 HTML 和 CSS。

HTML 代码:
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.         <meta charset="UTF-8">
  5.         <title>登录界面</title>
  6.         <link rel="stylesheet" href="style.css">
  7. </head>
  8. <body>
  9.         <div class="login-box">
  10.                 <img src="avatar.png" alt="avatar" class="avatar">
  11.                 <h1>登录</h1>
  12.                 <form>
  13.                         <label for="username">用户名</label>
  14.                         <input type="text" name="username" placeholder="请输入用户名">
  15.                         <label for="password">密码</label>
  16.                         <input type="password" name="password" placeholder="请输入密码">
  17.                         <input type="submit" value="登录">
  18.                 </form>
  19.         </div>
  20. </body>
  21. </html>
复制代码

CSS 代码:
  1. body {
  2.         margin: 0;
  3.         padding: 0;
  4.         background-color: #ccc;
  5. }
  6. .login-box {
  7.         position: absolute;
  8.         top: 50%;
  9.         left: 50%;
  10.         transform: translate(-50%, -50%);
  11.         width: 300px;
  12.         padding: 40px;
  13.         background-color: #fff;
  14.         border-radius: 10px;
  15.         box-shadow: 0 0 5px rgba(0,0,0,.3);
  16. }
  17. .avatar {
  18.         display: block;
  19.         margin: 0 auto 30px;
  20.         width: 100px;
  21.         height: 100px;
  22.         border-radius: 50%;
  23.         object-fit: cover;
  24. }
  25. h1 {
  26.         margin: 0;
  27.         padding: 0 0 20px;
  28.         font-size: 22px;
  29.         text-align: center;
  30. }
  31. form label {
  32.         margin: 0;
  33.         padding: 0;
  34.         font-weight: bold;
  35.         display: block;
  36. }
  37. form input {
  38.         width: 100%;
  39.         margin-bottom: 20px;
  40.         padding: 10px;
  41.         border-radius: 5px;
  42.         border: none;
  43.         background-color: #f2f2f2;
  44.         font-size: 16px;
  45. }
  46. form input[type="submit"] {
  47.         background-color: #008CBA;
  48.         color: #fff;
  49.         cursor: pointer;
  50.         transition: background-color .3s ease-in-out;
  51. }
  52. form input[type="submit"]:hover {
  53.         background-color: #006d96;
  54. }
复制代码

注意,需要将代码中的图片路径和样式文件路径替换为实际路径。
回复

使用道具 举报

38

主题

31

回帖

322

积分

管理员

积分
322
金钱
253

最佳新人活跃会员热心会员推广达人宣传达人

 楼主| 发表于 2023-5-15 03:14:42 | 显示全部楼层
写个 discuz  模板
回复

使用道具 举报

0

主题

4

回帖

10

积分

新手上路

积分
10
金钱
10
发表于 2023-5-15 03:15:00 | 显示全部楼层
admin 发表于 2023-05-15 03:14
写个 discuz  模板

Discuz是一款流行的论坛系统,以下是一个简单的 Discuz 模板示例:

<!DOCTYPE html>
<html>
<head>
        <meta charset="UTF-8">
        <title>Discuz模板</title>
        <link rel="stylesheet" href="template.css">
</head>
<body>
        <div id="wrapper">
                <header>
                        <h1>Discuz 论坛</h1>
                        <nav>
                                <ul>
                                        <li><a href="#">首页</a></li>
                                        <li><a href="#">帖子</a></li>
                                        <li><a href="#">用户中心</a></li>
                                        <li><a href="#">注册</a></li>
                                        <li><a href="#">登录</a></li>
                                </ul>
                        </nav>
                </header>
               
                <main>
                        <article>
                                <h2>最新帖子</h2>
                                <ul>
                                        <li><a href="#">帖子 1</a></li>
                                        <li><a href="#">帖子 2</a></li>
                                        <li><a href="#">帖子 3</a></li>
                                </ul>
                        </article>
                       
                        <aside>
                                <h3>热门话题</h3>
                                <ul>
                                        <li><a href="#">话题 1</a></li>
                                        <li><a href="#">话题 2</a></li>
                                        <li><a href="#">话题 3</a></li>
                                </ul>
                        </aside>
                </main>
               
                <footer>
                        <p>© 2021 Discuz 论坛.</p>
                </footer>
        </div>
</body>
</html>

样式文件 template.css:

/* Reset styles */
* {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
}

/* Main container */
#wrapper {
        max-width: 960px;
        margin: 0 auto;
        padding: 20px;
}

/* Header */
header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 20px;
}

header a {
        color: #333;
        text-decoration: none;
}

/* Navigation */
nav ul {
        display: flex;
        list-style-type: none;
}

nav li {
        margin-left: 20px;
}

/* Main content */
main {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
}

article, aside {
        flex-basis: calc(50% - 20px);
        margin-bottom: 20px;
}

article ul, aside ul {
        list-style-type: none;
}

/* Footer */
footer {
        margin-top: 20px;
        text-align: center;
        color: #666;
        font-size: 14px;
}
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|小黑屋|零度云 ( 浙ICP备13030903号-1 )

GMT+8, 2024-5-2 13:29 , Processed in 0.154730 second(s), 23 queries .

Powered by zero cloud X3.5

© 2001-2013 zero Inc. Templated By

快速回复 返回顶部 返回列表