Div+CSS仿微信公众平台登录页面

赶快上路吧,不要有一天我们在对方的葬礼上说,要是当时去了就好了。

本文实例为大家分享了Div+CSS仿微信公众平台登录页面的具体代码,供大家参考,具体内容如下

html代码:

XML/HTML Code复制内容到剪贴板
  1. <!DOCTYPEhtml>
  2. <htmllang="en">
  3. <head>
  4. <metacharset="UTF-8">
  5. <title>微信公众平台</title>
  6. <linkrel="stylesheet"type="text/css"rel="nofollow noopener noreferrer" href="weixin.css"/>
  7. </head>
  8. <body>
  9. <divid="header"class="head">
  10. <divclass="head_box">
  11. <divclass="innerwrp">
  12. <h1class="logo">
  13. <atitle="微信公众平台"rel="nofollow noopener noreferrer" href="javascript:void(0);">微信公众平台</a>
  14. </h1>
  15. <divclass="account">
  16. <divclass="account_metaaccount_faq">
  17. <atarget="_blank"rel="nofollow noopener noreferrer" href="javascript:void(0);">在线客服</a>
  18. </div>
  19. </div>
  20. </div>
  21. </div>
  22. </div>
  23. <divid="body">
  24. <divclass="innerwrp">
  25. <divclass="container_box">
  26. <divclass="login_panel">
  27. <divclass="login_panel_hd">
  28. <divclass="inner">
  29. <dlclass="system_info">
  30. <dt>微信公众平台接口测试账号申请</dt>
  31. <dd>无需公众账号、快速申请接口测试号</dd>
  32. <dd>直接体验和测试公众平台所以高级接口</dd>
  33. <ddclass="icon_sandbox"></dd>
  34. </dl>
  35. </div>
  36. </div>
  37. <divclass="login_panel_bd">
  38. <divclass="wxlogin_wrp">
  39. <divclass="wxlogin_desc">
  40. <h3>微信号扫一扫登录</h3>
  41. <p>免注册,方便快捷</p>
  42. </div>
  43. <divclass="wxlogin_opr">
  44. <pclass="btn_line">
  45. <aid="wx_loginBtn"class="btnbtn_primarybtn_wxlogin"rel="nofollow noopener noreferrer" href="javascript:void(0);">
  46. <imgclass="icon_wxlogo_inbtn"src="/images/weixin.png"></img>
  47. 登录
  48. </a>
  49. </p>
  50. <p>
  51. 若你已注册手机账号,请
  52. <aid="phone_loginBth"rel="nofollow noopener noreferrer" href="javascript:void(0);">点此登录</a>
  53. </p>
  54. </div>
  55. </div>
  56. </div>
  57. </div>
  58. </div>
  59. </div>
  60. </div>
  61. </body>
  62. </html>

CSS代码:

CSS Code复制内容到剪贴板
  1. body{
  2. min-width:1200px;
  3. background-color:#e7e8eb;
  4. font-family:"MicrosoftYaHei","微软雅黑",Helvetica,"黑体",Arial,Tahoma;
  5. font-size:14px;
  6. line-height:1.6;
  7. margin:0;
  8. }
  9. .head_box{
  10. position:relative;
  11. background-color:#fff;
  12. border-top:4pxsolid#44b549;
  13. border-bottom:1pxsolid#d9dadc;
  14. }
  15. .head_box.inner.wrp{
  16. width:1200px;
  17. margin-left:auto;
  18. margin-right:auto;
  19. }
  20. .head_box.inner{
  21. height:60px;
  22. }
  23. .logo{
  24. float:left;
  25. padding-top:8px;
  26. font-size:24px;
  27. }
  28. .logoa{
  29. display:block;
  30. width:248px;
  31. height:40px;
  32. overflow:hidden;
  33. text-decoration:none;
  34. color:#595959;
  35. margin-top:-15px;
  36. }
  37. .account{
  38. float:rightright;
  39. padding-top:10px;
  40. }
  41. .account_meta{
  42. display:inline-block;
  43. vertical-align:top;
  44. font-size:14px;
  45. }
  46. .account_metaa{
  47. text-decoration:none;
  48. color:#222;
  49. display:inline-block;
  50. margin-top:18px;
  51. }
  52. #body{
  53. width:1200px;
  54. margin-left:auto;
  55. margin-right:auto;
  56. padding:2.5em03.5em;
  57. }
  58. .container_box{
  59. min-height:650px;
  60. overflow:hidden;
  61. border:1pxsolid#d3d3d3;
  62. background-color:#fff;
  63. box-shadow:02px2px0#e3e3e3;
  64. border-radius:3px;
  65. }
  66. .login_panel_hd{
  67. height:140px;
  68. margin-bottom:50px;
  69. background:transparenturl(/images/weixin2.png)no-repeat00;
  70. }
  71. .login_panel_hd.inner{
  72. padding:24px;
  73. }
  74. .login_panel_hd.system_info{
  75. position:relative;
  76. margin-left:120px;
  77. color:#fff;
  78. }
  79. dt{
  80. font-size:22px;
  81. }
  82. dd{
  83. font-size:16px;
  84. margin:0px;
  85. }
  86. .login_panel_bd{
  87. margin:050px;
  88. }
  89. .login_panel_bd.wxlogin_wrp{
  90. text-align:center;
  91. }
  92. .login_panel_bd.wxlogin_desc{
  93. margin-bottom:20px;
  94. }
  95. .login_panel_bd.wxlogin_desch3{
  96. font-weight:400;
  97. font-style:normal;
  98. font-size:16px;
  99. margin:0;
  100. }
  101. .login_panel_bd.wxlogin_descp{
  102. margin:0px;
  103. }
  104. .login_panel_bd.wxlogin_wrp.wxlogin_opr.btn_line{
  105. padding-bottom:20px;
  106. }
  107. .btn{
  108. min-width:60px;
  109. display:inline-block;
  110. overflow:visible;
  111. padding:022px;
  112. line-height:30px;
  113. vertical-align:middle;
  114. text-align:center;
  115. font-size:14px;
  116. border-width:1px;
  117. border-style:solid;
  118. cursor:pointer;
  119. color:#fff;
  120. }
  121. .btn_primary{
  122. background-color:#44b549;
  123. }
  124. .icon_wxlogo_inbtn{
  125. vertical-align:middle;
  126. margin-right:5px;
  127. border:0;
  128. }
  129. a{
  130. text-decoration:none;
  131. color:#459ae9;
  132. outline:0;
  133. }

总结:

css中的vertical-align:middle;表示垂直居中的意思

line-height: 30px;表示行高30px;

overflow: visible/hidden;表示溢出的部分可见/隐藏

border-radius: 3px;表示圆角边框的半角为3px。

以上就是本文的全部内容,希望对大家学习CSS样式有所帮助。

标签: Div CSS