ASCII码 ASCII码

HTML登录表单的实现

发布于:2022-03-20 10:43:15  栏目:技术文档

登录表单的实现

代码如下:

  1. <!DOCTYPE html>
  2. <html lang="en">
  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. body{
  10. background-image: url(static/登录界面背景.jpg);
  11. background-size: 50%;
  12. background-repeat: no-repeat;
  13. background-position: center;
  14. }
  15. .login{
  16. padding-top: 120px;
  17. }
  18. </style>
  19. </head>
  20. <body>
  21. <form action="" width="500" height="400">
  22. <div class="login" align="center">
  23. <div>
  24. <label for="username">用户名</label>
  25. <input type="text" id="username" value="" placeholder="至少8位" autofocus required>
  26. </div>
  27. <div>
  28. <label for="pwd">密码:</label>
  29. <input type="password" name="pwd" value="" placeholder="数字+字母" required>
  30. </div>
  31. <div>
  32. <label for="my-email">邮箱:</label>
  33. <input type="email" name="my-email" value="" placeholder="abc@email.com" required>
  34. </div>
  35. <p></p>
  36. <div>
  37. <button>提交</button>
  38. </div>
  39. </div>
  40. </form>
  41. </body>
  42. </html>

运行代码后实际效果如图:

相关推荐
阅读 +