编程求助

求用HTML做一个登陆页面

正在寻***Lv.2 注册会员 发表于 2022-6-11 · 最后回复 2023-11-12 IP:广东省 2,665 6
求用HTML做一个登陆页面qwq
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>login</title>
    </head>
    <body>
        <h1>登录</h1>
        <form>
            账号:<input type="text" name="name">
            密码:<input type="password" name="password">
        </form>
        <button type="button" onclick="find()">登录</button>
        <script>
            function find(){  
            var search_name = document.getElementById("search_name").value;  
            var password = localStorage.getItem(search_password);  
            var find_result = document.getElementById("find_result");  
            find_result.innerHTML = search_site + "test" + siteurl;  
            }
        </script>
        <h1>注册</h1>
        <form>
            账号:<input type="text" name="name">
            密码:<input type="password" name="password">
        </form>
        <button type="button" onclick="save()">注册</button>
        <script>
            function save(){  
                var password = document.getElementById("password").value;  
                var name = document.getElementById("name").value;  
                localStorage.setItem(name, password);
                alert("注册成功");
            }
            function loadAll(){  
                var list = document.getElementById("list");  
                if(localStorage.length>0){  
                    var result = "<table border='1'>";  
                    result += "<tr><td>key</td><td>value</td></tr>";  
                    for(var i=0;i<localStorage.length;i++){  
                    var name = localStorage.key(i);  
                    var password = localStorage.getItem(password);  
                    result += "<tr><td>"+name+"</td><td>"+password+"</td></tr>";  
                }  
                result += "<table></table>";  
                list.innerHTML = result;  
                }else{  
                    list.innerHTML = "数据为空……";  
                }  
            }      
        </script>
    </body>
</html>

这是我做的,失败了qaq
回复 6 最早 最新 只看楼主
MingH***Lv.3 中级会员
2022-6-11 20:04:42 IP:河北省
评论复审中... 编号:2363235

html.rar

2.7 MB, 下载次数:

3# 2022-6-11 20:04:42 回复 收起回复
小永***Lv.5 金牌会员
2023-9-20 16:31:03 · 来自手机 IP:广西
本帖最后由 小永高呐 于 2023-9-21 10:22 编辑

给你个我这的,不过只是空按钮,需要自己对接下后端才可以用

预览:https://download.kstore.space/download/5005/yanshi/login.html

  1. <!DOCTYPE html>
  2. <html lang="zh">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>登录本站</title>
  8. <style>
  9. * {
  10.     margin: 0;
  11.     padding: 0;
  12.     box-sizing: border-box;
  13. }
  14. html {
  15.     font-size: 10px;
  16. }
  17. html::before {
  18.     content: '';
  19.     width: 100%;
  20.     height: 100%;
  21.     position: fixed;
  22.     z-index: -1;
  23. }
  24. ::selection {
  25.     color: #fff;
  26.     background-color: rgb(144,129,241);
  27. }
  28. .box {
  29.     display: flex;
  30.     overflow: hidden;
  31.     width: 90rem;
  32.     height: 55rem;
  33.     background-color: rgba(255,255,255,70%);
  34.     border-radius: 1.5rem;
  35.     margin: 10% auto;
  36.     box-shadow: 0 0 1rem 0.2rem rgb(0 0 0 / 10%);
  37. }
  38. .box .left {
  39.     position: relative;
  40.     width: 35%;
  41.     height: 100%;
  42. }
  43. .box .left::before {
  44.     content: '';
  45.     position: absolute;
  46.     width: 100%;
  47.     height: 100%;
  48.     background-image: url(https://xiaoyonggaoya.pages.dev/login/login-tp.png);
  49.     background-size: cover;
  50. }
  51. .box .right {
  52.     display: flex;
  53.     width: 65%;
  54.     flex-direction: column;
  55.     align-items: center;
  56. }
  57. .box .right h2{
  58.     color: rgb(144,129,241);
  59.     font-size: 3rem;
  60.     margin-top: 5rem;
  61. }
  62. .box .right form {
  63.     display: flex;
  64.     flex-wrap: wrap;
  65.     justify-content: center;
  66. }
  67. .box .right form .acc {
  68.     outline: none;
  69.     width: 80%;
  70.     height: 5rem;
  71.     font-size: 1.6rem;
  72.     margin-top: 5rem;
  73.     padding: 1rem 0 0 1.6rem;
  74.     border: none;
  75.     border-bottom:1px solid rgb(144,129,241) ;
  76.     color: rgb(144,129,241);
  77.     background-color: rgba(0,0,0,0);
  78. }
  79. .right form .acc:focus {
  80.     outline: none;
  81.     color: rgb(144,129,241);
  82.     padding: 1rem 0 0 1.6rem;
  83. }
  84. .right .submit {
  85.     width: 60%;
  86.     height: 5rem;
  87.     color: #f6f6f6;
  88.     background-image: linear-gradient(120deg, #e0c3fc 0%, #8ec5fc 100%);
  89.     font-size: 1.4rem;
  90.     border: none;
  91.     border-radius: 0.5rem;
  92.     margin: 6rem 0 0 50%;
  93.     transform: translateX(-50%);
  94. }
  95. .right .submit:hover {
  96.     box-shadow: 0 0 2rem -0.5rem rgb(0 0 0 / 15%);
  97. }
  98. .right .fn {
  99.     display: flex;
  100.     justify-content: space-between;
  101.     margin-top: 1rem;
  102.     width: 70%;
  103. }
  104. .right .fn font {
  105.     font-size: 1.3rem;
  106.     margin-top: 5rem;
  107.     padding: 1rem 2rem;
  108.     color: #666;
  109. }
  110. .right .fn font:hover {
  111.     color: rgb(144,129,241);
  112. }
  113. </style>
  114. <script>
  115. function meshinaxidadedog(){
  116. alert("账号登录成功!");}
  117. function kleeworldfirstcute(){
  118. alert("抱歉,注册功能还未开放!");}
  119. function yoimiyadedidudiduzbc(){
  120. alert("抱歉,找回密码功能还未开放");}
  121. </script>
  122. <link rel="icon" href="https://xiaoyonggaoya.pages.dev/live/img/icon.jpg">
  123. </head>
  124. <body background="https://xiaoyonggaoya.pages.dev/login/bg.jpg" style="overflow:hidden;background-repeat:no-repeat;background-size:100%100%;background-attachment:fixed;">
  125. <div class="box">
  126. <div class="left"></div>
  127. <div class="right">
  128. <h2>登 录</h2>
  129. <form action="">
  130. <input class="acc" type="text" placeholder="用户名">
  131. <input class="acc" type="password" placeholder="密码">
  132. <input class="submit" type="submit" value="登录账号" onclick="meshinaxidadedog()">
  133. </form>
  134. <div class="fn">
  135. <font onclick="yoimiyadedidudiduzbc()">找回密码</font>
  136. <font onclick="kleeworldfirstcute()">注册账户</font>
  137. </div></div></div>
  138. </body>
  139. </html>
复制代码
5# 2023-9-20 16:31:03 回复 收起回复
您需要登录后才可以回帖 登录 | 立即注册
本版积分规则