当前位置:   article > 正文

【html+css】html登录注册页面_登录注册页面代码

登录注册页面代码

为大家提供一个登录注册的html代码,包含css样式代码,需要的朋友可以直接用,背景图片可根据自己的想法调换,本篇未提供背景图片。

登录页面展示

注册页面显示

 html代码

登录页面

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>登录</title>
  6. <link rel="stylesheet" href="css/login.css">
  7. </head>
  8. <style>
  9. body{
  10. background: url("img/logo.jpg");
  11. background-position: center;
  12. background-size: 100%;
  13. }
  14. </style>
  15. <body>
  16. <div class="主体区">
  17. <div class="登录框">
  18. <form action="">
  19. <h2>登录</h2>
  20. <div>
  21. <span>用户名</span>
  22. <input type="text" class="text" placeholder="请输入用户名">
  23. </div>
  24. <div>
  25. <span>密码</span>
  26. <input type="password" class="text" placeholder="请输入密码">
  27. </div>
  28. <div>
  29. <a href="index.html"><input type="button" class="提交" value="登录"></a>
  30. </div>
  31. <div>
  32. <a href="logon.html" ><input type="button" class="提交" value="注册"></a>
  33. </div>
  34. <div>
  35. <a href="index.html" ><input type="button" value="返回"></a>
  36. </div>
  37. </form>
  38. </div>
  39. </div>
  40. </body>
  41. </html>

注册页面

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>注册</title>
  6. <link rel="stylesheet" href="css/logon.css">
  7. </head>
  8. <style>
  9. body{
  10. background: url("img/logo.jpg");
  11. background-position: center;
  12. background-size: 100%;
  13. }
  14. </style>
  15. <body>
  16. <div class="主体区">
  17. <div class="注册框">
  18. <form action="">
  19. <h2>注册</h2>
  20. <div>
  21. <span>昵称</span>
  22. <input type="text" class="text" placeholder="请输入昵称">
  23. </div>
  24. <div>
  25. <span>年龄</span>
  26. <input type="text" class="text" placeholder="请输入年龄">
  27. </div>
  28. <div>
  29. <span class="sex">性别</span>
  30. <input type="radio" name="sex">
  31. <input type="radio" name="sex">
  32. </div>
  33. <div>
  34. <span class="hobby">爱好</span>
  35. <input type="checkbox">吃饭
  36. <input type="checkbox">睡觉
  37. <input type="checkbox">打游戏
  38. </div>
  39. <div>
  40. <span>职业</span>
  41. <input type="text" class="text" placeholder="请输入职业">
  42. </div>
  43. <div>
  44. <span>Email</span>
  45. <input type="text" class="text" placeholder="请输入Email">
  46. </div>
  47. <div>
  48. <span>密码</span>
  49. <input type="password" class="text" placeholder="请输入密码">
  50. </div>
  51. <div>
  52. <span>再次确认密码</span>
  53. <input type="password" class="text" placeholder="请再次确认密码">
  54. </div>
  55. <div>
  56. <input type="button" class="提交" value="注册">
  57. </div>
  58. <div>
  59. <a href="login.html" ><input type="button" class="提交" value="返回登录"></a>
  60. </div>
  61. </form>
  62. </div>
  63. </div>
  64. </body>
  65. </html>

 css样式

登录页面css

  1. .主体区 {
  2. padding: 150px;
  3. display: flex;
  4. align-items: center;
  5. flex-direction: column;
  6. }
  7. .登录框 {
  8. width: 350px;
  9. height: 300px;
  10. padding-top: 50px;
  11. padding-bottom: 50px;
  12. border-radius: 10px;
  13. background-color: rgba(255,255,255,0.7);
  14. }
  15. form {
  16. height: 100%;
  17. display: flex;
  18. align-items: center;
  19. flex-direction: column;
  20. justify-content: space-between;
  21. }
  22. h2 {
  23. font-size: 40px;
  24. }
  25. span {
  26. font-size: 20px;
  27. display: inline-block;
  28. width: 90px;
  29. text-align: left;
  30. }
  31. .提交 {
  32. width: 260px;
  33. height: 30px;
  34. background: rgba(77,132,226);
  35. color: white;
  36. border: none;
  37. }
  38. .text {
  39. width: 165px;
  40. height: 25px;
  41. padding-left: 10px;
  42. border-radius: 5px;
  43. border: none;
  44. }

注册页面css

  1. .主体区 {
  2. padding: 30px;
  3. display: flex;
  4. align-items: center;
  5. flex-direction: column;
  6. }
  7. .注册框 {
  8. width: 360px;
  9. height: 500px;
  10. padding-top: 50px;
  11. padding-bottom: 50px;
  12. border-radius: 10px;
  13. background-color: rgba(255,255,255,0.7);
  14. }
  15. form {
  16. height: 100%;
  17. display: flex;
  18. align-items: center;
  19. flex-direction: column;
  20. justify-content: space-between;
  21. }
  22. h2 {
  23. font-size: 20px;
  24. }
  25. span {
  26. display: inline-block;
  27. width: 120px;
  28. text-align: left;
  29. }
  30. .sex {
  31. width: 225px;
  32. }
  33. .hobby {
  34. width: 125px;
  35. }
  36. .提交 {
  37. width: 290px;
  38. height: 30px;
  39. background: rgba(77,132,226);
  40. color: white;
  41. border: none;
  42. }
  43. .text {
  44. width: 165px;
  45. height: 25px;
  46. padding-left: 10px;
  47. border-radius: 5px;
  48. border: none;
  49. }

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/不正经/article/detail/428420
推荐阅读
相关标签
  

闽ICP备14008679号