当前位置:   article > 正文

一般pc端首页怎么布局比较好_创意pc首页布局

创意pc首页布局

之前一直都不知道首页布局怎么处理比较好;写了几个首页页面后自己觉得绝对定位展示各种分辨率下适配比较好

首先要实现下列首页布局

现在的做法是:先获取文字到下面框的高度;获取中间部分盒子的宽度;写一个盒子之后绝对定位到页面中间;之后进行内部布局

  1. <template>
  2. <div class="login-container">
  3. <div style="height:557px;position: absolute;top:0;bottom:0;right:0;left:0;margin:auto;">
  4. <div class="title-container">
  5. <h3 class="title">智慧园区运营管理平台</h3>
  6. </div>
  7. <div class="loginBg">
  8. <div class="loginLeft">
  9. <div class="tipText">
  10. Hello!<br>
  11. Welcome to here.
  12. </div>
  13. <div class="enterBtn" @click="companyEnter">
  14. 企业版入口 >>
  15. </div>
  16. </div>
  17. <div class="loginRight">
  18. <div class="loginTetx">用户登录</div>
  19. <el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form" autocomplete="on" label-position="left">
  20. <el-form-item prop="username">
  21. <!-- <span class="svg-container">-->
  22. <!-- <svg-icon icon-class="user" />-->
  23. <!-- </span>-->
  24. <el-input
  25. ref="username"
  26. v-model="loginForm.username"
  27. placeholder="用户名"
  28. name="username"
  29. type="text"
  30. tabindex="1"
  31. autocomplete="on"
  32. />
  33. </el-form-item>
  34. <el-tooltip v-model="capsTooltip" content="Caps lock is On" placement="right" manual>
  35. <el-form-item prop="password">
  36. <!-- <span class="svg-container">-->
  37. <!-- <svg-icon icon-class="password" />-->
  38. <!-- </span>-->
  39. <el-input
  40. :key="passwordType"
  41. ref="password"
  42. v-model="loginForm.password"
  43. :type="passwordType"
  44. placeholder="密码"
  45. name="password"
  46. tabindex="2"
  47. autocomplete="on"
  48. @keyup.native="checkCapslock"
  49. @blur="capsTooltip = false"
  50. @keyup.enter.native="handleLogin"
  51. />
  52. <span class="show-pwd" @click="showPwd">
  53. <svg-icon :icon-class="passwordType === 'password' ? 'eye' : 'eye-open'" />
  54. </span>
  55. </el-form-item>
  56. </el-tooltip>
  57. <el-button :loading="loading" type="primary" style="width:100%;margin-bottom:30px;font-size: 16px;" @click.native.prevent="handleLogin">登录</el-button>
  58. <div style="text-align: right;color: #fff;cursor: pointer;" @click="showDialog=true">忘记密码</div>
  59. </el-form>
  60. </div>
  61. </div>
  62. </div>
  63. <el-dialog title="系统提示" :visible.sync="showDialog" width="400px">
  64. 请联系管理员:0571-8888888
  65. </el-dialog>
  66. </div>
  67. </template>
  68. <style lang="scss">
  69. /* 修复input 背景不协调 和光标变色 */
  70. /* Detail see https://github.com/PanJiaChen/vue-element-admin/pull/927 */
  71. $bg:#283443;
  72. $light_gray:#fff;
  73. $cursor: #fff;
  74. @supports (-webkit-mask: none) and (not (cater-color: $cursor)) {
  75. .login-container .el-input input {
  76. color: $cursor;
  77. }
  78. }
  79. /* reset element-ui css */
  80. .login-container {
  81. .el-input {
  82. display: inline-block;
  83. height: 40px;
  84. /*width: 85%;*/
  85. input {
  86. background: #fff;
  87. border: 0px;
  88. -webkit-appearance: none;
  89. border-radius: 0px;
  90. padding: 12px 5px 12px 15px;
  91. color: #000;
  92. height: 40px;
  93. caret-color: #000;
  94. /*&:-webkit-autofill {
  95. box-shadow: 0 0 0px 1000px $bg inset !important;
  96. -webkit-text-fill-color: $cursor !important;
  97. }*/
  98. }
  99. }
  100. .el-form-item {
  101. border: 1px solid rgba(255, 255, 255, 0.1);
  102. background: rgba(0, 0, 0, 0.1);
  103. border-radius: 5px;
  104. color: #454545;
  105. }
  106. }
  107. </style>
  108. <style lang="scss" scoped>
  109. $bg:#2d3a4b;
  110. $dark_gray:#889aa4;
  111. $light_gray:#eee;
  112. .login-container {
  113. min-height: 100%;
  114. width: 100%;
  115. overflow: hidden;
  116. background: url("../../assets/image/gardenBg.jpg") no-repeat;
  117. background-size: 100% 100%;
  118. position: relative;
  119. .loginBg{
  120. width: 990px;
  121. height: 400px;
  122. background: rgba(0,0,0,0.5);
  123. margin: 0 auto;
  124. .loginLeft{
  125. float: left;
  126. padding: 120px 70px;
  127. .tipText{
  128. color: #fff;
  129. font-size: 32px;
  130. }
  131. .enterBtn{
  132. color: #2FBFFF;
  133. font-size: 24px;
  134. margin-top: 24px;
  135. cursor: pointer;
  136. }
  137. }
  138. .loginRight{
  139. float: right;
  140. width:420px;
  141. height:440px;
  142. background:rgba(255,255,255,0.2);
  143. box-shadow:0px 6px 15px 0px rgba(0,0,0,0.8);
  144. border-radius:2px;
  145. margin-top: -20px;
  146. margin-right: 26px;
  147. padding: 80px 35px;
  148. .loginTetx{
  149. font-size: 22px;
  150. color: #fff;
  151. }
  152. }
  153. }
  154. .login-form {
  155. position: relative;
  156. padding-top: 40px;
  157. margin: 0 auto;
  158. overflow: hidden;
  159. }
  160. .tips {
  161. font-size: 14px;
  162. color: #fff;
  163. margin-bottom: 10px;
  164. span {
  165. &:first-of-type {
  166. margin-right: 16px;
  167. }
  168. }
  169. }
  170. .svg-container {
  171. padding: 6px 5px 6px 15px;
  172. color: $dark_gray;
  173. vertical-align: middle;
  174. width: 30px;
  175. display: inline-block;
  176. }
  177. .title-container {
  178. position: relative;
  179. .title {
  180. font-size: 50px;
  181. color: $light_gray;
  182. margin: 0px auto 100px auto;
  183. text-align: center;
  184. font-weight: 500;
  185. }
  186. }
  187. .show-pwd {
  188. position: absolute;
  189. right: 10px;
  190. top: 7px;
  191. font-size: 16px;
  192. color: $dark_gray;
  193. cursor: pointer;
  194. user-select: none;
  195. }
  196. .thirdparty-button {
  197. position: absolute;
  198. right: 0;
  199. bottom: 6px;
  200. }
  201. @media only screen and (max-width: 470px) {
  202. .thirdparty-button {
  203. display: none;
  204. }
  205. }
  206. }
  207. </style>

有更好的方法可以留言哦~

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