用html写用户登录界面

先在主体中用input写出用户名密码框和登陆按钮(图2),用function定义一个a的函数(图1),并求出用户名和密码的值,在登陆语句中用onclick连接function函数,假如用户名为空,则弹出用户名非法,若密码为空,弹出密码非法,若用户名和密码都符合要求,则显示到data.html页面(data.html要和调用它的文件放在同一目录下 图3)否则显示密码错误p1
p2
p3

  • 14
    点赞
  • 79
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
以下是一个简单的HTML登陆界面示例: ```html <!DOCTYPE html> <html> <head> <title>Login Page</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <style type="text/css"> body { background-color: #f2f2f2; font-family: Arial, sans-serif; } form { background-color: #fff; border-radius: 5px; padding: 20px; box-shadow: 0px 0px 10px #ccc; max-width: 400px; margin: 0 auto; margin-top: 50px; } input[type="text"], input[type="password"] { width: 100%; padding: 10px; border: none; border-radius: 3px; margin-bottom: 15px; box-shadow: 0px 0px 5px #ccc; } input[type="submit"] { background-color: #4CAF50; color: #fff; border: none; border-radius: 3px; padding: 10px; cursor: pointer; font-size: 16px; float: right; } input[type="submit"]:hover { background-color: #3e8e41; } h1 { text-align: center; color: #333; margin-bottom: 30px; } </style> </head> <body> <form> <h1>Login</h1> <label for="username">Username:</label> <input type="text" id="username" name="username" required> <label for="password">Password:</label> <input type="password" id="password" name="password" required> <input type="submit" value="Login"> </form> </body> </html> ``` 这个登陆界面包括一个标题、两个输入框(一个用于输入用户名,另一个用于输入密码)和一个提交按钮。当用户点击提交按钮时,表单将被提交到服务器进行处理。你可以在服务器端使用编程语言(如PHP、Python、Java等)来验证用户输入的用户名和密码是否正确,如果正确则允许用户登录

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值