博客列表 >Flex布局来设计会员登录页

Flex布局来设计会员登录页

易开网-水手
易开网-水手原创
2019年11月14日 19:47:381019浏览
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport"
  6. content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  7. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  8. <title>会员登录</title>
  9. <style>
  10. *{
  11. margin:0;
  12. padding:0;
  13. /*outline: 1px dashed #cccccc;*/
  14. }
  15. body{
  16. display: flex;
  17. height: 100vh;
  18. flex-flow: column nowrap;
  19. /*居中显示*/
  20. justify-content: center;
  21. align-items: center;
  22. font-weight: lighter;
  23. background: linear-gradient(to top, lightgreen, white, lightgreen);
  24. }
  25. .container{
  26. position:relative;
  27. margin-top: -80px;
  28. padding:20px;
  29. width:280px;
  30. }
  31. .container >h1{
  32. font-weight: lighter;
  33. text-align: center;
  34. font-size: 1.5rem;
  35. padding: 20px ;
  36. }
  37. .container>form{
  38. display: flex;
  39. flex-flow: column nowrap;
  40. border: 1px solid #ccc ;
  41. border-radius:12px;
  42. padding: 20px;
  43. background: linear-gradient(to top, lightcyan, white, lightcyan);
  44. }
  45. .container>form>div{
  46. padding: 10px;
  47. }
  48. .container>form:hover{
  49. background: linear-gradient(to right, white, lightcyan);
  50. box-shadow: 0 0 5px #2d6a88;
  51. }
  52. .container>form>div{
  53. display: flex;
  54. }
  55. .container>form>div>input{
  56. flex:1;
  57. border:1px #999999;
  58. border-radius: 5px;
  59. padding-left:5px;
  60. }
  61. .container>form>div>button{
  62. flex:1;
  63. border:1px;
  64. border-radius: 5px;
  65. background-color: #1c82d4;
  66. letter-spacing: 10px;
  67. color: #fff;
  68. padding: 3px;
  69. box-shadow: 0 2px 1px darkolivegreen;
  70. }
  71. .container>form>div>button:hover{
  72. box-shadow: 0 0 3px #2d6a88;
  73. background-color: #1c82d4;
  74. }
  75. </style>
  76. </head>
  77. <body>
  78. <div class="container">
  79. <h1>会员登录</h1>
  80. <form action="index.html">
  81. <div>
  82. <label for="useremail">邮箱:</label>
  83. <input type="text" name="useremail" id="useremail" placeholder="请输入邮箱" required />
  84. </div>
  85. <div>
  86. <label for="password">密码:</label>
  87. <input type="password" name="password" id="password" placeholder="请输入密码" required minlength="6" maxlength="18" />
  88. </div>
  89. <div>
  90. <button>登录</button>
  91. </div>
  92. </form>
  93. </div>
  94. </body>
  95. </html>
声明:本文内容转载自脚本之家,由网友自发贡献,版权归原作者所有,如您发现涉嫌抄袭侵权,请联系admin@php.cn 核实处理。
全部评论
文明上网理性发言,请遵守新闻评论服务协议