博客列表 >简单的登录表单

简单的登录表单

土老帽
土老帽原创
2022年03月20日 22:01:09549浏览

登陆表单

效果图

html代码

  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. </head>
  9. <style>
  10. .top {
  11. background: #008ead;
  12. width: 100%;
  13. height: 400px;
  14. padding: 0px;
  15. margin: 0px;
  16. font-size: 20px;
  17. }
  18. .fra {
  19. width: 400px;
  20. height: 250px;
  21. margin: auto auto;
  22. background: #ffffff;
  23. text-align: center;
  24. border: 5px solid #e7e7e7;
  25. }
  26. .box {
  27. position: absolute; /* 1. 开启绝对定位 */
  28. left: 50%; /* 3. 向右偏移父元素宽度的50% */
  29. top: 50%; /* 4. 向下偏移父元素宽度的50% */
  30. transform: translate(-50%, -50%); /* 5. 使用translate根据自身的宽度向左位移50%,向上位移50%*/
  31. }
  32. </style>
  33. <body>
  34. <div class="top">
  35. <div class="fra box">
  36. <h2>登陆后台管理</h2>
  37. <form action="" method="post">
  38. <div>
  39. <label for="username">用户名:</label>
  40. <input type="text" id="username" name="username" value="" placeholder="请输入用户名" autofocus required />
  41. </div>
  42. <div>
  43. <label for="password">密码:</label>
  44. <input type="password" id="password" name="password" value="" placeholder="请输入密码" required />
  45. </div>
  46. <div>
  47. <label for="email">邮箱:</label>
  48. <input type="email" id="email" name="email" value="" placeholder="请输入邮箱" required />
  49. </div>
  50. <div>
  51. <button>登陆</button>
  52. </div>
  53. </form>
  54. </div>
  55. </div>
  56. </body>
  57. </html>
声明:本文内容转载自脚本之家,由网友自发贡献,版权归原作者所有,如您发现涉嫌抄袭侵权,请联系admin@php.cn 核实处理。
全部评论
文明上网理性发言,请遵守新闻评论服务协议