飞道的博客

“数万行代码“教你用html和css编写一个精美的网页

582人阅读  评论(0)

我是歌谣 放弃很容易 但是坚持一定很酷

1前言

作为一名前端开发工程师 开发一个完美的网页也是我们的必修课之一 逻辑写起来有时候不是那么的难 据说页面样式才是最难的一课

本文内容纯属自己个人观点 欢迎一起交流吐槽

2网页基础版(div+css)

我第一次接触前端页面的时候做的网页就是一个div+css的布局 因为当时是在实习 网页的内容现在已经丢失 类似一个商品管理的页面 页面分出来给一个班的同学

几个人分为一个小组 进行共同开发 页面的跳转直接a标签进行跳转即可

 2.1.1桥边菇凉页面预览

桥边菇凉小页面 写这个页面当时应该是这个音乐还挺好听的 我叫歌谣 喜欢听歌也是我生活的一部分 这个页面包含了太多的岁月沉淀了   现在2021年了 这个页面就是基础的div+css布局

2.1.2桥边菇凉代码

这个页面应该不是第一个 一看这个样式就是我模仿某页面进行一个开发的


  
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  7. <title>qq音乐 </title>
  8. <style>
  9. *{ margin: 0; padding: 0;}
  10. img{ display:block;}
  11. a{ text-decoration: none;}
  12. #head{ height: 102px; width: 100%;}
  13. #head-left{ width: 798px; height: 102px; float:left}
  14. #head-left> img{ width: 192px; height: 47px; float: left; padding-left: 141px; padding-top: 27px;}
  15. #head-left> .username{ width: 304px; height: 24px; background: url( './img/006.jpg') right center no-repeat ; padding-top: 10px; position: relative; top: 30px; float: right;}
  16. #header{ height: 63px; background: rgb( 40, 50, 59);}
  17. #last{ height: 102px; background: rgb( 41, 45, 54);}
  18. #head-right{ width: 720px; height: 102px; float: left;}
  19. #head-title{ width: 333px; height: 27px; position: relative; top: 35px; left: 105px; float: left; border-right: rgb( 230, 230, 230) 3px solid;}
  20. #head-title> a{ margin-left: 20px;}
  21. #head-right-right> img{ width: 68px; height: 37px; position: relative; top: 28px; left: 150px;}
  22. #header-left{ width: 798px; height: 63px; float:left}
  23. #header-right{ width: 720px; height: 63px; float: left;}
  24. #left{ width: 486px; height: 39px; position: relative; left: 228px; top: 15px;}
  25. #left> a{ color: white; font-size: 20px; padding-left: 20px;}
  26. #right> img{ width: 28px; height: 20px; float:right; position: relative; right: 225px; bottom: 20px;}
  27. #header-right{ width: 572px; height: 31px;}
  28. .geyao{ position: relative; top: 15px; left: 50px;}
  29. .geyao> img{ width: 20px; height: 20px; float: left;}
  30. .geyao> .right1{ position: relative; top: 4px; left: 8px;}
  31. .geyao> .right2{ position: relative; top: 5px; left: 8px;}
  32. .geyao> .right3{ position: relative; top: 4px; left: 8px;}
  33. .geyao> .right4{ position: relative; top: 4px; left: 8px;}
  34. .geyao> .right5{ position: relative; top: 4px; left: 8px;}
  35. .geyao> a{ font-size: 20px; float: left; color: rgb( 160, 161, 163); padding-left: 15px;}
  36. #body{ height: 581px; background: rgb( 73, 86, 111);}
  37. #body-left{ width: 798px; height: 581px; float: left;}
  38. #body-left1{ width: 324px; height: 324px; margin: 0 auto;}
  39. #body-left2{ width: 290px; height: 66px; border-radius: 30px; border: 1px solid rgb( 136, 143, 160);
  40. margin: 30px auto;}
  41. #body-left2> span{ font-size: 40px; font-family: 宋体; display: block; color: rgb( 136, 143, 160);
  42. position: relative; left: 35px; top: 10px;}
  43. #body-left3{ position: relative; left: 200px;}
  44. #body-top{ width: 68px; height: 68px; border-radius: 34px; background: url( './img/15.jpg'); float: left;}
  45. #body-bottom{ width: 301px; height: 74px; background: url( './img/16.jpg'); float: left;}
  46. #body-right{ width: 720px; height: 531px; float: left;}
  47. #body-right1{ width: 503px; height: 131px;}
  48. #body-right1> h1{ color: rgb( 136, 143, 160);}
  49. #body-right1> img{ width: 32px; height: 16px; position: relative; bottom: 30px; left: 130px;}
  50. #body-right3> p{ display: block; color: rgb( 136, 143, 160);}
  51. #body-right2{ width: 503px; height: 300px; overflow-y: scroll;}
  52. #body-right2 ::-webkit-scrollbar { width: 4px; /*height: 4px;*/}
  53. #body-right2 ::-webkit-scrollbar-thumb { border-radius: 10px; -webkit-box-shadow: inset 0 0 5px rgba( 0, 0, 0, 0.2); background: rgba( 0, 0, 0, 0.2);}
  54. #body-right2 ::-webkit-scrollbar-track { -webkit-box-shadow: inset 0 0 5px rgba( 0, 0, 0, 0.2); border-radius: 0; background: rgba( 0, 0, 0, 0.1);}
  55. #last1{ width: 330px; height: 100px; float: left;}
  56. #last1> .im1{ float: left; position: relative; left: 100px ; top: 20px; width: 50px; height: 50px; padding-left: 10px;}
  57. #last1> .im2{ float: left; position: relative; left: 115px ; top: 10px; width: 60px; height: 60px;
  58. padding-left: 10px;}
  59. #last1> .im3{ float: left; position: relative; left: 140px ; top: 25px; width: 50px; height: 50px;
  60. padding-left: 10px;}
  61. #last2{ width: 579px; height: 79px; float: left;}
  62. #last2-left{ width: 57px; height: 57px; float: left; position: relative; left: 120px; top: 10px;}
  63. #last2-right{ width: 357px; height: 57px; float: left; position: relative; left: 140px; top: 13px;}
  64. #last3{ width: 131px; height: 102px; float: left;}
  65. #last31{ width: 13px; height: 33px; float: left; position: relative; left: 160px; top: 40px;}
  66. #last32{ width: 13px; height: 33px; float: left; position: relative; left: 190px; top: 40px;}
  67. #last33{ width: 13px; height: 33px; float: left; position: relative; left: 220px; top: 40px;}
  68. #last34{ width: 13px; height: 33px; float: left; position: relative; left: 250px; top: 40px;}
  69. #last35{ width: 43px; height: 33px; float: left; position: relative; left: 300px; top: 35px;}
  70. </style>
  71. </head>
  72. <body>
  73. <div id="head">
  74. <div id="head-left">
  75. <img src="./img/004.jpg" alt="">
  76. <input type="text" class="username">
  77. </div>
  78. <div id="head-right">
  79. <div id="head-title">
  80. <a href="">客服中心 </a>
  81. <a href="">招贤纳士 </a>
  82. <a href="">会员中心 </a>
  83. </div>
  84. <div id="head-right-right">
  85. <img src="./img/007.jpg">
  86. </div>
  87. </div>
  88. </div>
  89. <div id="header">
  90. <div id="header-left">
  91. <div id="left">
  92. <a href="">首页 </a>
  93. <a href="">榜单 </a>
  94. <a href="">下载客户端 </a>
  95. <a href="">更多 </a>
  96. </div>
  97. <div id="right">
  98. <img src="./img/008.jpg">
  99. </div>
  100. </div>
  101. <div id="header-right">
  102. <div class="geyao">
  103. <img class="right1" src="./img/1.jpg">
  104. <a href="">音乐直播 </a>
  105. </div>
  106. <div class="geyao">
  107. <img class="right2" src="./img/2.jpg">
  108. <a href="">酷狗LIVE </a>
  109. </div>
  110. <div class="geyao">
  111. <img class="right3" src="./img/3.jpg">
  112. <a href="">音乐人 </a>
  113. </div>
  114. <div class="geyao">
  115. <img class="right4" src="./img/4.jpg">
  116. <a href="">成为主播 </a>
  117. </div>
  118. <div class="geyao">
  119. <img class="right5" src="./img/5.jpg">
  120. <a href="">商城 </a>
  121. </div>
  122. </div>
  123. </div>
  124. </div>
  125. <div id="body">
  126. <div id="body-left">
  127. <div id="body-left1">
  128. <img src="./img/11.jpg">
  129. </div>
  130. <div id="body-left2">
  131. <span>下载这首歌 </sapn>
  132. </div>
  133. <div id="body-left3">
  134. <div id="body-top"> </div>
  135. <div id="body-bottom"> </div>
  136. </div>
  137. </div>
  138. <div id="body-right">
  139. <div id="body-right1">
  140. <h1>桥边姑娘 </h1>
  141. <img src="./img/20.jpg">
  142. <div id="body-right3">
  143. <p>专辑:桥边姑娘 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;歌手:海伦 </p>
  144. </div>
  145. </div>
  146. <div id="body-right2">
  147. <p>桥边姑娘 - 海伦 </br>
  148. 词:海伦 </br>
  149. 曲:海伦 </br>
  150. 视觉:华玮轩 </br>
  151. 暖阳下 我迎芬芳 是谁家的姑娘 </br>
  152. 我走在了那座小桥上 </br>
  153. 你抚琴奏忧伤 </br>
  154. 桥边歌唱的小姑娘 你眼角在流淌 </br>
  155. 你说一个人在逞强 一个人念家乡 </br>
  156. 风华模样 你落落大方 </br>
  157. 坐在桥上 我听你歌唱 </br>
  158. 我说桥边姑娘 你的芬芳 </br>
  159. 我把你放心上 刻在了我心膛 </br>
  160. 桥边姑娘 你的忧伤 </br>
  161. 我把你放心房 不想让你流浪 </br>
  162. 暖阳下的桥头旁 有这样一姑娘 </br>
  163. 她有着长长的乌黑发 一双眼明亮 </br>
  164. 姑娘你让我心荡漾 小鹿在乱撞 </br>
  165. 你说无人在身旁 一个人在流浪 </br>
  166. 风华模样 你落落大方 </br>
  167. 坐在桥上 我听你歌唱 </br>
  168. 我说桥边姑娘 你的芬芳 </br>
  169. 我把你放心上 刻在了我心膛 </br>
  170. 桥边姑娘 你的忧伤 </br>
  171. 我把你放心房 不想让你流浪 </p>
  172. </div>
  173. </div>
  174. </div>
  175. <div id="last">
  176. <div id="last1">
  177. <div class="im1">
  178. <img src="./img/22.jpg">
  179. </div>
  180. <div class="im2">
  181. <img src="./img/23.jpg">
  182. </div>
  183. <div class="im3">
  184. <img src="./img/25.jpg">
  185. </div>
  186. </div>
  187. <div id="last2">
  188. <div id="last2-left">
  189. <img src="./img/28.jpg">
  190. </div>
  191. <div id="last2-right">
  192. <img src="./img/29.jpg">
  193. </div>
  194. </div>
  195. <div id="last3">
  196. <div id="last31">
  197. <img src="./img/31.jpg" alt="">
  198. </div>
  199. <div id="last32">
  200. <img src="./img/32.jpg" alt="">
  201. </div>
  202. <div id="last33">
  203. <img src="./img/33.jpg" alt="">
  204. </div>
  205. <div id="last34">
  206. <img src="./img/34.jpg" alt="">
  207. </div>
  208. <div id="last35">
  209. <img src="./img/35.jpg" alt="">
  210. </div>
  211. </div>
  212. </div>
  213. </body>
  214. </body>
  215. </html>

2.2.1博文尚美页面预览

这个页面的来源应该是来自于某学习平台 时间也是比较久远的

 

2.2.2博文尚美页面代码

这边也是一个简单的div+css的布局 页面不是简简单单的单页面开发了 居然多了公共样式 也是不会采用多余的布局 上面的桥边菇凉应该就是参照改布局进行布局的

index.html


  
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  7. <title>博文尚美 </title>
  8. <link rel="stylesheet" href="./css/common.css">
  9. <style>
  10. #banner{ position: relative;}
  11. #banner .banner_list{ width: 100%; height: 469px; position: relative;}
  12. #banner .banner_list li{ background: center 0 no-repeat; width: 100%; height: 100%; position: absolute; left: 0; top: 0; opacity: 0; z-index: 1;}
  13. #banner .banner_list a{ display: block; width: 100%; height: 100%;}
  14. #banner .banner_list li .active{ opacity: 1; z-index: 10;}
  15. #banner .banner_btn{ width: 100%; position: absolute; bottom: 19px; font-size: 0; text-align: center; z-index: 20;}
  16. #banner .banner_btn li{ display: inline-block; width: 12px; height: 12px; border: 2px solid white ;
  17. border-radius: 50%; box-sizing: border-box; margin: 0 6px; cursor: pointer;}
  18. #banner .banner_btn li .active{ background: white;}
  19. #service{ overflow: hidden; min-height: 407px;}
  20. #service .area_title{ text-align: center;}
  21. #service .service_list{ text-align: center; margin-top: 34px;}
  22. #service .service_list li{ float: left; width: 250px; margin: 0 10px;}
  23. #service .service_list div{ width: 102px; height: 102px; margin: 0 auto;}
  24. #service .service_list li :nth-of-type(1) div{ background-image: url(./images/web1.png);}
  25. #service .service_list li :nth-of-type(2) div{ background-image: url(./images/mail1.png);}
  26. #service .service_list li :nth-of-type(3) div{ background-image: url(./images/graphic1.png);}
  27. #service .service_list li :nth-of-type(4) div{ background-image: url(./images/e-bussiness1.png);}
  28. #service .service_list h3{ font-size: 18-x; color: #434343; line-height: 36px;}
  29. #service .service_list p{ font-size: 14px; color: #6D6D6D; line-height: 22px;}
  30. #case{ background: #f8f8f8;}
  31. #case .container{ min-height: 460px; overflow: hidden;}
  32. #case .area_title{ margin-top: 55px;}
  33. #case .area_title h2{ color: #66c5B4;}
  34. #case .case_list{ margin-top: 28px;}
  35. #case .case_list li{ float: left; width: 340px; margin: 0 10px;}
  36. #case .case_btn{ width: 176px; height: 37px; background: #66C584; margin: 0 auto;
  37. border-radius: 25px; line-height: 37px; text-align: center; color: white; font-size: 14px; margin-top: 36px;}
  38. #case .case_btn a{ display: block; width: 100%; height: 100%;}
  39. #news{ min-height: 450px; overflow: hidden;}
  40. #news .area_title{ margin-top: 65px;}
  41. #news dl{ margin-top: 48px;}
  42. #news dt{ width: 234px;}
  43. #news dd{ width: 846px;}
  44. #news .news_list{ width: 100%;}
  45. #news .news_list li{ width: 50%; float: left; margin-bottom: 48px;}
  46. #news .news_date{ width: 71px; height: 70px; border-right: 1px solid #DCDCDC; text-align: center;}
  47. #news .news_date i{ color: #66C584; font-size: 39px; display: block; font-weight: bold;}
  48. #news .news_date span{ color: #999999; font-size: 20px; line-height: 36px;}
  49. #news .news_text{ width: 310px; margin-left: 20px;}
  50. #news .news_text h3{ font-size: 14px;}
  51. #news .news_text h3 a{ color: #3F3F3F}
  52. #news .news_text p{ color: #A4A4A4; font-size: 12px; line-height: 21px; margin-top: 17px;}
  53. </style>
  54. </head>
  55. <body>
  56. <div id="head" class="container">
  57. <div class="head_logo l">
  58. <a href="#">
  59. <img src="./images/logo.png" alt="" title="博文尚美">
  60. </a>
  61. </div>
  62. <ul class="head_menu r">
  63. <li>
  64. <a href="#">HOME </a>
  65. </li>
  66. <li>
  67. <a href="#">ABOUT </a>
  68. </li>
  69. <li>
  70. <a href="#">PROTFOLIO </a>
  71. </li>
  72. <li>
  73. <a href="#">SERVICE </a>
  74. </li>
  75. <li>
  76. <a href="#">CONTACT </a>
  77. </li>
  78. </ul>
  79. </div>
  80. <div id="banner" class="container-fluid">
  81. <ul class="banner_list">
  82. <li class="active" style="background-image: url(./images/banner.png);">
  83. <a href="#"> </a>
  84. </li>
  85. <li style="background-image: url(./images/banner.png);">
  86. <a href="#"> </a>
  87. </li>
  88. <li style="background-image: url(./images/banner.png);">
  89. <a href="#"> </a>
  90. </li>
  91. <li style="background-image: url(./images/banner.png);">
  92. <a href="#"> </a>
  93. </li>
  94. </ul>
  95. <ol class="banner_btn">
  96. <li class="active">
  97. </li>
  98. <li>
  99. </li>
  100. <li>
  101. </li>
  102. <li>
  103. </li>
  104. </ol>
  105. </div>
  106. <div id="service" class="container">
  107. <div class="area_title">
  108. <h2>服务范围 </h2>
  109. <p>OUT SERVICES </p>
  110. </div>
  111. <ul class="service_list">
  112. <li>
  113. <div> </div>
  114. <h3>1.web design </h3>
  115. <p>我是歌谣,我是最棒的 <br>我是歌谣,我是最棒的 </p>
  116. </li>
  117. <li>
  118. <div> </div>
  119. <h3>2.graphic design </h3>
  120. <p>我是歌谣,我是最棒的 <br>我是歌谣,我是最棒的 </p>
  121. </li>
  122. <li>
  123. <div> </div>
  124. <h3>3.e-business plan </h3>
  125. <p>我是歌谣,我是最棒的 <br>我是歌谣,我是最棒的 </p>
  126. </li>
  127. <li>
  128. <div> </div>
  129. <h3>4.mailboxagents </h3>
  130. <p>我是歌谣,我是最棒的 <br>我是歌谣,我是最棒的 </p>
  131. </li>
  132. </ul>
  133. </div>
  134. <div id="case" class="container-fluid">
  135. <div class="container">
  136. <div class="area_title">
  137. <h2>[客户案例] </h2>
  138. <p>with the bost professional technology,to design the best inn </p>
  139. </div>
  140. <ul class="case_list clear">
  141. <li>
  142. <li> <a href="#"> <img src="./images/20141121095528549.png" alt=""> </a> </li>
  143. </li>
  144. <li>
  145. <li> <a href="#"> <img src="./images/20141121095528549.png" alt=""> </a> </li>
  146. </li>
  147. <li>
  148. <li> <a href="#"> <img src="./images/20141121095528549.png" alt=""> </a> </li>
  149. </li>
  150. </ul>
  151. <div class="case_btn">
  152. <a href="#">view movn </a>
  153. </div>
  154. </div>
  155. </div>
  156. <div id="news" class="container">
  157. <div class="area_title">
  158. <h2>最新资讯 </h2>
  159. <p>TEN LATEST NEWS </p>
  160. </div>
  161. <dl>
  162. <dt class="l">
  163. <img src="./images/xs1.png">
  164. </dt>
  165. <dd class="l">
  166. <ul class="news_list">
  167. <li>
  168. <div class="news_date l">
  169. <i>09 </i>
  170. <span>jan </span>
  171. </div>
  172. <div class="news_text l">
  173. <h3> <a href="#">网站排名前三的技巧说明 </a> </h3>
  174. <p>我是歌谣我是歌谣我是歌谣我是歌谣我是歌谣我是歌谣 </p>
  175. </div>
  176. </li>
  177. <li>
  178. <div class="news_date l">
  179. <i>09 </i>
  180. <span>jan </span>
  181. </div>
  182. <div class="news_text l">
  183. <h3> <a href="#">网站排名前三的技巧说明 </a> </h3>
  184. <p>我是歌谣我是歌谣我是歌谣我是歌谣我是歌谣我是歌谣 </p>
  185. </div>
  186. </li>
  187. <li>
  188. <div class="news_date l">
  189. <i>09 </i>
  190. <span>jan </span>
  191. </div>
  192. <div class="news_text l">
  193. <h3> <a href="#">网站排名前三的技巧说明 </a> </h3>
  194. <p>我是歌谣我是歌谣我是歌谣我是歌谣我是歌谣我是歌谣 </p>
  195. </div>
  196. </li>
  197. <li>
  198. <div class="news_date l">
  199. <i>09 </i>
  200. <span>jan </span>
  201. </div>
  202. <div class="news_text l">
  203. <h3> <a href="#">网站排名前三的技巧说明 </a> </h3>
  204. <p>我是歌谣我是歌谣我是歌谣我是歌谣我是歌谣我是歌谣 </p>
  205. </div>
  206. </li>
  207. </ul>
  208. </dd>
  209. </dl>
  210. </div>
  211. </body>
  212. </html>

common.css


  
  1. *{ margin: 0; padding: 0;}
  2. ul, ol{ list-style: none;}
  3. img{ display: block;}
  4. a{ text-decoration: none; color: #646464;}
  5. h1, h2, h3{ font-size: 16px;}
  6. body{ font-family: Arial, Helvetica, sans-serif;}
  7. .l{ float: left;}
  8. .r{ float: right;}
  9. .clear :after{ content: ""; display: block; clear: both;}
  10. .container{ width: 1080px; margin: 0 auto; position: relative;}
  11. .container-fluid{ width: 100%;}
  12. /* 浮动元素不会出现传递操作 */
  13. #head{ height: 81px;}
  14. #head .head_logo{ width: 162px; height: 44px; margin-top: 19px;}
  15. #head .head_menu{ font-size: 14px; line-height: 81px;}
  16. #head .head_menu li{ float: left; margin-left: 54px;}
  17. .area_title{ margin-top: 60px; text-align: center;}
  18. .area_title h2{ height: 20px; line-height: 20px; font-size: 20px; color: #363636; background: url(../images/title_bg.png) no-repeat center 7px; font-weight: bold;}
  19. .area_title p{ color: #9F9F9F; font-size: 14px; line-height: 14px;}

2.3.1qq飞车页面预览

对于这种网页一看就不是网上学习所能够获得的 只能通过自己的慢慢手写 那时候还是有毅力的

2.3.2qq飞车页面代码

不断的多练 多写 对样式的理解 页面自然越来越熟悉 代码 这部分也多有了公共的样式编写

 


  
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  7. <title>qq飞车首页 </title>
  8. <link rel="stylesheet" href="./css1/common.css">
  9. <style>
  10. /* 导航栏块 */
  11. /* 加入大块背景图 */
  12. #main{ background: url(./images1/bg20190104.jpg) no-repeat center 0;}
  13. /* 两块背景图 */
  14. #nav{ min-height: 236px; background: url(./images1/nav_down_re.png) repeat-x, url(./images1/nav.png) no-repeat center 0;}
  15. #nav .container{ min-height: 236px; overflow: hidden;}
  16. /* 插入图片 解决margin传递的问题 */
  17. #nav .nav_logo{ width: 138px; height: 112px; margin: 15px auto;}
  18. #nav dl{ position: absolute; top: 0;}
  19. #nav dt{ height: 66px;}
  20. #nav dt a{ width: 100%; height: 100%; display: block; text-indent: 9999px; overflow: hidden;}
  21. #nav dd{ line-height: 27px; font-size: 12px; text-align: center;}
  22. #nav dd a{ color:white; position: relative;}
  23. /* 实现a标签点击实现变颜色和出现下划线 */
  24. #nav dd a :hover{ color: red; text-decoration: underline;}
  25. /* 利用伪类添加小图标效果 */
  26. #nav dd a .hot ::after, #nav dd a .new :after{ content: ""; display: block; width: 12px; height: 12px; background: url(./images1/nav_tips.png) no-repeat; position: absolute; right: - 15px; top: 0;}
  27. #nav dd a .hot ::after{ background-position: 0 - 12px;}
  28. #nav dd a .new ::after{ background-position: 0 0;}
  29. #nav .nav_index{ width: 65px; left: 0;}
  30. #nav .nav_zl{ width: 69px; left: 98px;}
  31. #nav .nav_ss{ width: 74px; left: 203px;}
  32. #nav .nav_hd{ width: 68px; left: 325px;}
  33. #link{ height: 175px;}
  34. #link a{ width: 100%; height: 100%; display: block; margin: 0 auto;}
  35. #banner{ height: 276px; background: url(./images1/top.png) no-repeat; margin-top: 20px;}
  36. #banner .banner_left{ width: 240px; height: 310px; background: url(./images1/down_user_spr.png) no-repeat; margin:- 20px 0 0 7px;}
  37. #banner .banner_download p{ width: 91px; height: 25px; background: url(./images1/down_user_spr.png) no-repeat - 253px 0; margin: 0 auto; text-indent: - 9999px; overflow: hidden;}
  38. #banner .banner_download p :first-child{ background-position: - 253px 0; margin-top: 44px;}
  39. #banner .banner_download p :last-child{ background-position: - 253px - 25px;}
  40. /* css3简单的动画效果 */
  41. #banner .banner_download :hover p :first-child{ animation: 1s upMove;}
  42. @keyframes upMove{
  43. 0%{ transform: translateY(- 40px); opacity: 0;}
  44. 100%{ transform: translateY( 0); opacity: 1;}
  45. }
  46. #banner .banner_download :hover p :last-child{ animation: 1s downMove;}
  47. @keyframes downMove{
  48. 0%{ transform: translateY( 40px); opacity: 0;}
  49. 100%{ transform: translateY( 0); opacity: 1;}
  50. }
  51. /* css3简单的动画效果 */
  52. #banner .banner_user div{ width: 56px; height: 56px; border-radius: 50%; margin: 85px auto 0 auto; border: 2px solid #283257;
  53. box-sizing: border-box; overflow: hidden;}
  54. #banner .banner_user img{ width: 100%; height: 100%;}
  55. #banner .banner_user p{ text-align: center; font-size: 12px; color: white; margin-top: 25px;}
  56. #banner .banner_user a{ color: turquoise;}
  57. #banner .banner_list{ width: 497px; height: 253px; overflow: hidden; margin: 13px 0 0 4px; position: relative;}
  58. #banner .banner_list_ul{ width: 2000px;}
  59. #banner .banner_list_ul li{ width: 497px; height: 25px; float: left;}
  60. #banner .banner_bottomline{ width: 100%; height: 37px; background: rgba( 0, 0, 0, . 5); border-top: 1px #514b55 solid ; position: absolute; left: 0; bottom: 0;}
  61. #banner .banner_bottomline_ul{ text-align: center; margin-top: 11px;}
  62. #banner .banner_bottomline ul li{ display: inline-block; width: 15px; height: 15px; background: url(./images1/top.png) no-repeat - 603px - 299px; cursor: pointer;}
  63. #banner .banner_bottomline ul li .active{ background-position: - 581px - 299px;}
  64. #banner .banner_bottomline_leftbtn, #banner .banner_bottomline_rightbtn{ width: 12px; height: 22px; position: absolute; top: 5px; background: url(./images1/top.png) no-repeat; cursor: pointer;}
  65. #banner .banner_bottomline_leftbtn{ left: 5px; background-position: - 542px - 296px;}
  66. #banner .banner_bottomline_rightbtn{ right: 5px; background-position: - 554px - 296px;}
  67. #banner .banner_bottomline_leftbtn :hover{ background-position:- 542px - 325px;}
  68. #banner .banner_bottomline_rightbtn :hover{ background-position:- 554px - 325px;}
  69. #banner .banner_list_lt, #banner .banner_list_rt, #banner .banner_list_rb, #banner .banner_list_lb{ width: 12px; height: 12px; background: url(./images1/top.png) no-repeat; position: absolute;}
  70. #banner .banner_list_lt{ left:- 2px; top:- 4px; background-position: - 621px - 299px;}
  71. #banner .banner_list_rt{ right:- 2px; top:- 4px; background-position: - 634px - 299px;}
  72. #banner .banner_list_rb{ right:- 2px; bottom:- 5px; background-position: - 634px - 312px;}
  73. #banner .banner_list_lb{ left:- 2px; bottom:- 5px; background-position: - 621px - 312px;}
  74. #banner .banner_right{ width: 209px; height: 255px; position: relative; margin: 12px 0 0 12px}
  75. #banner .banner_right_lt, #banner .banner_right_rt, #banner .banner_right_rb, #banner .banner_right_lb{ width: 15px; height: 15px; background: url(./images1/top.png) no-repeat; position: absolute;}
  76. #banner .banner_right_lt{ left:- 4px; top:- 4px; background-position: - 681px - 298px;}
  77. #banner .banner_right_rt{ right:- 4px; top:- 4px; background-position: - 696px - 298px;}
  78. #banner .banner_right_rb{ right:- 4px; bottom:- 6px; background-position: - 696px - 313px;}
  79. #banner .banner_right_lb{ left:- 4px; bottom:- 6px; background-position: - 681px - 313px;}
  80. </style>
  81. </head>
  82. <body>
  83. <!-- 通栏里面放个版心 三张图片 两张靠左 一张右边浮动 -->
  84. <div id="head" class="container-fluid">
  85. <div class="container">
  86. <div class="head_logo l">
  87. <a href="#">腾讯游戏 </a>
  88. </div>
  89. <div class="head_ad l">
  90. <a href="#">
  91. <img src="./images1/ad.jpg" alt="">
  92. </a>
  93. </div>
  94. <div class="head_menu r">
  95. <div class="head_menu_czsh l">
  96. <a href="#">成长守护平台 </a>
  97. </div>
  98. <div class="head_menu_top l">
  99. <a href="#">腾讯游戏排行版 </a>
  100. </div>
  101. </div>
  102. </div>
  103. </div>
  104. <!-- 导航这一块 -->
  105. <div id="main" class="container-fluid">
  106. <div id="nav" class="container-fluid">
  107. <div class="container">
  108. <div class="nav_logo">
  109. <a href="#">
  110. <img src="./images1/inside_logo.png" alt="qq飞车" title="qq飞车">
  111. </a>
  112. </div>
  113. <dl class="nav_index">
  114. <dt>
  115. <a href="#">首页 </a>
  116. </dt>
  117. </dl>
  118. <dl class="nav_zl">
  119. <dt> </dt>
  120. <dd> <a href="">新手指引 </a> </dd>
  121. <dd> <a class="hot" href="">官方漫画 </a> </dd>
  122. <dd> <a class="new" href="">飞车手游 </a> </dd>
  123. <dd> <a href="">精美壁纸 </a> </dd>
  124. <dd> <a href="">游戏下载 </a> </dd>
  125. </dl>
  126. <dl class="nav_zx">
  127. <dt> </dt>
  128. <dd> <a href="">ssc </a> </dd>
  129. <dd> <a href="">谁是车王 </a> </dd>
  130. <dd> <a href="">全明争霸赛 </a> </dd>
  131. </dl>
  132. <dl class="nav_ss">
  133. <dt> </dt>
  134. <dd> <a href="">ssc </a> </dd>
  135. <dd> <a href="">谁是车王 </a> </dd>
  136. <dd> <a href="">全明争霸赛 </a> </dd>
  137. </dl>
  138. <dl class="nav_hd">
  139. <dt> </dt>
  140. <dd> <a href="">版本专区 </a> </dd>
  141. <dd> <a href="">合作专区 </a> </dd>
  142. <dd> <a href="">CDK兑换 </a> </dd>
  143. </dl>
  144. </div>
  145. </div>
  146. <div id="link" class="container">
  147. <a href="#"> </a>
  148. </div>
  149. <div id="banner" class="container">
  150. <div class="banner_left l">
  151. <div class="banner_download">
  152. <p>下载游戏 </p>
  153. <p>DOWNLOAD </p>
  154. </div>
  155. <div class="banner_user">
  156. <div>
  157. <img src="./images1/56x56.jpg" alt="">
  158. </div>
  159. <p>欢迎 <a href="#">首页 </a>登录,进入飞车世界 </p>
  160. </div>
  161. </div>
  162. <div class="banner_center l">
  163. <div class="banner_list">
  164. <ul class="banner_list_ul">
  165. <li>
  166. <a href="" alt=""> <img src="http://ossweb-img.qq.com/upload/adw/image/20190510/6ae827443c667576e26fa4d48d93e199-80.jpg" alt=""> </a>
  167. </li>
  168. <li>
  169. <a href="" alt=""> <img src="http://ossweb-img.qq.com/upload/adw/image/20190508/178c724ac47ee0f74e32b4a386dd5808-80.jpg" alt=""> </a>
  170. </li>
  171. <li>
  172. <a href="" alt=""> <img src="http://ossweb-img.qq.com/upload/adw/image/20190513/f7aa08a33c9ee8f1d66d543b10cba86b-80.jpg" alt=""> </a>
  173. </li>
  174. </ul>
  175. <div class="banner_bottomline">
  176. <ul class="banner_bottomline_ul">
  177. <li class="active"> </li>
  178. <li> </li>
  179. <li> </li>
  180. </ul>
  181. <div class="banner_bottomline_leftbtn"> </div>
  182. <div class="banner_bottomline_rightbtn"> </div>
  183. </div>
  184. <i class="banner_list_lt"> </i>
  185. <i class="banner_list_rt"> </i>
  186. <i class="banner_list_rb"> </i>
  187. <i class="banner_list_lb"> </i>
  188. </div>
  189. </div>
  190. <diV class="banner_right l">
  191. <a href="#"> <img src="./images1/bebae86c3d1f64d50a53434ed5458d22-80.jpg" alt=""> </a>
  192. <i class="banner_right_lt"> </i>
  193. <i class="banner_right_rt"> </i>
  194. <i class="banner_right_rb"> </i>
  195. <i class="banner_right_lb"> </i>
  196. </diV>
  197. </div>
  198. </div>
  199. </body>
  200. </html>

common.css


  
  1. /* 可复用样式全部放在这个css文件里面 */
  2. /* 清除页面中的默认样式 */
  3. *{ margin: 0; padding: 0;}
  4. /* 设置为块级标签 */
  5. img{ display: block;}
  6. /* 去除小圆点 */
  7. ul, ol{ list-style: none;}
  8. /* 去除下划线 */
  9. a{ text-decoration: none; color: #464646;}
  10. /* 设置文字大小 */
  11. h1, h2, h3{ font-size: 16px;}
  12. /* 设置字体 */
  13. body{ font-family: Arial, '宋体';}
  14. /* 左右浮动和清除浮动 */
  15. /* 左浮动 */
  16. .l{ float: left;}
  17. /* 右浮动 */
  18. .r{ float: right;}
  19. /* 清除浮动 */
  20. .clear :after{ content: ""; display: block; clear: both;}
  21. /* 设置通栏和版心 */
  22. /* 版心 */
  23. .container{ width: 980px; margin: 0 auto; position: relative;}
  24. /* 通栏 */
  25. .container-fluid{ width: 100%;}
  26. /* 背景图片横向铺开 */
  27. #head{ background: url( '../images1/head_bg.png') repeat-x;}
  28. /* 设置版心的高度 */
  29. #head .container{ height: 41px;}
  30. /* 插入logo图片 */
  31. #head .head_logo{ width: 220px; height: 41px; background: url(../images1/ost-bg.png) no-repeat 0 - 38px;}
  32. /* 通过a链接给整个图片加上一个小手 */
  33. #head .head_logo a{ display: block; width: 100%; height: 100%; text-indent: - 9999px; overflow: hidden;}
  34. /* 设置图片之间的间距 */
  35. #head .head_ad{ margin-left: 8px;}
  36. /* 设置字体大小 */
  37. #head .head_menu{ font-size: 12px;}
  38. /* 设置上边距 */
  39. #head .head_menu div{ height: 18px; margin-top: 13px; background: url(../images1/ost-bg.png) no-repeat;}
  40. /* 插入小图标 */
  41. #head .head_menu .head_menu_czsh{ margin-right: 26px; padding-left: 20px; background-position: left - 91px;}
  42. /* 插入小图标 */
  43. #head .head_menu .head_menu_top{ padding-right: 17px; background-position: right - 91px;}

2.4.1站酷网页面预览

这些都是简单的div+css布局 不会使用组件库或者插件 页面也是不断的模仿加工 学习

2.4.2站酷网页面代码


  
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  7. <title>站酷网 </title>
  8. <link rel="stylesheet" href="./zhankucss/common.css">
  9. <style>
  10. .head{ width: 100%; height: 71px; background: url(./zhankuimg/left.jpg) no-repeat 34px 20px, url(./zhankuimg/jin.jpg) no-repeat 1189px 20px, url(./zhankuimg/yun.jpg) no-repeat 1249px 20px, url(./zhankuimg/head.jpg);}
  11. .head .left
  12. .head .left img{ width: 141px; height: 24px;}
  13. .middle ul{ width: 800px; margin: 0 auto;}
  14. .middle ul li{ float: left; width: 100px; height: 100%; line-height: 71px;}
  15. .right dd{ width: 100px; overflow: hidden;}
  16. .right dt{ float: left; line-height: 71px; margin-left: 20px; position: relative; left: 130px;}
  17. .body{ margin-top: 20px;}
  18. .section .section1 li{ width: 85px; height: 50px; float: left; line-height: 50px;}
  19. .section .section1 li a{ color: black;}
  20. .section2{ margin: 0 auto; width: 400px; height: 100px;}
  21. .section2 li{ width: 85px; height: 50px; float: left; line-height: 50px; margin-left: 35px; position: relative;}
  22. .section2 li .hot ::after{ content: ""; display: block; width: 30px; height: 30px; background: url(./zhankuimg/title.jpg) no-repeat; position: absolute; left: 75px; top: 15px;}
  23. .footer{ width: 100%;}
  24. .footer ul li div{ width: 264px; height: 360px; float: left; margin-top: 20px; margin-left: 15px;}
  25. .footer ul li div img{ width: 100%;}
  26. .footer ul li div dl dt{ font-size: 20px; color: rgb( 84, 51, 51); background: url(./zhankuimg/hot.jpg) no-repeat 240px 5px;}
  27. .footer ul li div dl dd{ font-size: 12px; color: rgb( 187, 187, 206);}
  28. .footer ul li div dl .dd1 span{ width: 50px; height: 20px; display: block; float: left; text-align: right; line-height: 20px;}
  29. .footer ul li div dl .dd1 .span1{ background: url(./zhankuimg/eye.jpg) no-repeat 5px;}
  30. .footer ul li div dl .dd1 .span2{ background: url(./zhankuimg/eye.jpg) no-repeat 5px;}
  31. .footer ul li div dl .dd1 .span3{ background: url(./zhankuimg/eye.jpg) no-repeat 5px;}
  32. .footer ul li div dl .dd2{ position: relative; left: - 150px;}
  33. /* .footer ul li div dl .dd1 .span2{width: 21px;height: 16px;background: url(./zhankuimg/eye.jpg) no-repeat;}
  34. .footer ul li div dl .dd1 .span3{width: 21px;height: 16px;background: url(./zhankuimg/eye.jpg) no-repeat;} */
  35. </style>
  36. </head>
  37. <body>
  38. <div class="container_fluid">
  39. <div class="head">
  40. <div class="middle">
  41. <ul>
  42. <li> <a href=""> 首页 </a> </li>
  43. <li> <a href=""> 发现 </a> </li>
  44. <li> <a href=""> 同城 </a> </li>
  45. <li> <a href=""> 职位 </a> </li>
  46. <li> <a href=""> 活动 </a> </li>
  47. <li> <a href=""> 正版素材 </a> </li>
  48. <li> <a href=""> 课程 </a> </li>
  49. <li> <a href=""> ... </a> </li>
  50. </ul>
  51. </div>
  52. <div class="right">
  53. <dl>
  54. <dd>
  55. <dt>登录 </dt>
  56. <dt>注册 </dt>
  57. </dd>
  58. </dl>
  59. </div>
  60. </div>
  61. </div>
  62. <div class="container">
  63. <div class="body">
  64. <img src="./zhankuimg/content.jpg">
  65. </div>
  66. </div>
  67. <div class="container">
  68. <div class="section">
  69. <ul class="section1">
  70. <li> <a href="">全部 </a> </li>
  71. <li> <a href="">平面 </a> </li>
  72. <li> <a href="">UI </a> </li>
  73. <li> <a href="">网页 </a> </li>
  74. <li> <a href="">插画 </a> </li>
  75. <li> <a href="">动漫 </a> </li>
  76. <li> <a href="">摄影 </a> </li>
  77. <li> <a href="">空间 </a> </li>
  78. <li> <a href="">工业/产品 </a> </li>
  79. <li> <a href="">三维 </a> </li>
  80. <li> <a href="">影视 </a> </li>
  81. <li> <a href="">手工艺 </a> </li>
  82. <li> <a href="">纯艺术 </a> </li>
  83. <li> <a href="">服装 </a> </li>
  84. <li> <a href="">其他 </a> </li>
  85. <li> <a href="">自定义 </a> </li>
  86. </ul>
  87. </div>
  88. <ul class="section2">
  89. <li class="hot">编辑精选 </li>
  90. <li>最新发布 </li>
  91. <li>上升最快 </li>
  92. </ul>
  93. </div>
  94. <div class="container-fluid">
  95. <div class="container">
  96. <div class="footer">
  97. <ul>
  98. <li>
  99. <div>
  100. <img src="./zhankuimg/1.jpg">
  101. <dl>
  102. <dt>我是最萌的图片
  103. </dt>
  104. <dd>影视宣传片 </dd>
  105. <dd class="dd1">
  106. <span class="span1">59 </span>
  107. <span class="span2">0 </span>
  108. <span class="span3">1 </span> </dd>
  109. <br>
  110. <dd class="dd2">麻薯印象 </dd>
  111. </dl>
  112. </div>
  113. </li>
  114. <li>
  115. <div>
  116. <img src="./zhankuimg/2.jpg">
  117. <dl>
  118. <dt>运维5G高效摄入法 </dt>
  119. <dd>网页其他网页 </dd>
  120. <dd class="dd1">
  121. <span class="span1">59 </span>
  122. <span class="span2">0 </span>
  123. <span class="span3">1 </span> </dd>
  124. <br>
  125. <dd class="dd2">麻薯印象 </dd>
  126. </dl>
  127. </div>
  128. </li>
  129. <li>
  130. <div>
  131. <img src="./zhankuimg/3.jpg">
  132. <dl>
  133. <dt>运营专题高效摄入法 </dt>
  134. <dd>热点内容 </dd>
  135. <dd class="dd1">
  136. <span class="span1">59 </span>
  137. <span class="span2">0 </span>
  138. <span class="span3">1 </span> </dd>
  139. <br>
  140. <dd class="dd2">麻薯印象 </dd>
  141. </dl>
  142. </div>
  143. </li>
  144. <li>
  145. <div>
  146. <img src="./zhankuimg/4.jpg">
  147. <dl>
  148. <dt>运营专题高效摄入法
  149. </dt>
  150. <dd>热点内容 </dd>
  151. <dd class="dd1">
  152. <span class="span1">59 </span>
  153. <span class="span2">0 </span>
  154. <span class="span3">1 </span> </dd>
  155. <br>
  156. <dd class="dd2">麻薯印象 </dd>
  157. </dl>
  158. </div>
  159. </li>
  160. <li>
  161. <div>
  162. <img src="./zhankuimg/5.jpg">
  163. <dl>
  164. <dt>运营专题高效摄入法 </dt>
  165. <dd>热点内容 </dd>
  166. <dd class="dd1">
  167. <span class="span1">59 </span>
  168. <span class="span2">0 </span>
  169. <span class="span3">1 </span> </dd>
  170. <br>
  171. <dd class="dd2">麻薯印象 </dd>
  172. </dl>
  173. </div>
  174. </li>
  175. </ul>
  176. <ul>
  177. <li>
  178. <div>
  179. <img src="./zhankuimg/1.jpg">
  180. <dl>
  181. <dt>我是最萌的图片 </dt>
  182. <dd>影视宣传片 </dd>
  183. <dd>麻薯印象 </dd>
  184. </dl>
  185. </div>
  186. </li>
  187. <li>
  188. <div>
  189. <img src="./zhankuimg/2.jpg">
  190. <dl>
  191. <dt>运维5G高效摄入法 </dt>
  192. <dd>网页其他网页 </dd>
  193. <dd>麻薯印象 </dd>
  194. </dl>
  195. </div>
  196. </li>
  197. <li>
  198. <div>
  199. <img src="./zhankuimg/3.jpg">
  200. <dl>
  201. <dt>运营专题高效摄入法 </dt>
  202. <dd>热点内容 </dd>
  203. <dd>麻薯印象 </dd>
  204. </dl>
  205. </div>
  206. </li>
  207. <li>
  208. <div>
  209. <img src="./zhankuimg/4.jpg">
  210. <dl>
  211. <dt>运营专题高效摄入法 </dt>
  212. <dd>热点内容 </dd>
  213. <dd>麻薯印象 </dd>
  214. </dl>
  215. </div>
  216. </li>
  217. <li>
  218. <div>
  219. <img src="./zhankuimg/5.jpg">
  220. <dl>
  221. <dt>运营专题高效摄入法 </dt>
  222. <dd>热点内容 </dd>
  223. <dd>麻薯印象 </dd>
  224. </dl>
  225. </div>
  226. </li>
  227. </ul>
  228. </div>
  229. </div>
  230. </div>
  231. </body>
  232. </html>

common.css


  
  1. *{ margin: 0; padding: 0;}
  2. img{ display: block;}
  3. a{ text-decoration: none;}
  4. ul, ol{ list-style: none;}
  5. h1, h2, h3{ font-size: 16px;}
  6. body{ font-family: Arial, Helvetica, sans-serif;}
  7. /* 左右浮动和清除浮动 */
  8. /* 左浮动 */
  9. .l{ float: left;}
  10. /* 右浮动 */
  11. .r{ float: right;}
  12. /* 清除浮动 */
  13. .clear :after{ content: ""; display: block; clear: both;}
  14. /* 设置通栏和版心 */
  15. /* 版心 */
  16. .container{ width: 1414px; margin: 0 auto; position: relative;}
  17. /* 通栏 */
  18. .container-fluid{ width: 100%;}

2.5.1后台静态管理页面预览

2.5.2后台静态管理页面页面代码

总归就是闲来无事做 就不如画画页面练练手 不断的进行一个输出和成长 代码有点多 后面叙述会节省一点 不能做到任何代码都贴在上面


  
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  7. <title>正达管理后台 </title>
  8. <link rel="stylesheet" href="./zhcss/common.css">
  9. <link rel="stylesheet" href="./iconfont/iconfont.css">
  10. <style>
  11. #projectTitle .projectTitle_text{ margin: 21px 0 0 22px; color: #333333;}
  12. #projectTitle .projectTitle_text h2{ font-size: 24px; line-height: 25px;}
  13. #projectTitle .projectTitle_text p{ font-size: 14px; line-height: 30px; margin: 10px 0 13px 0;}
  14. #projectTitle .projectTitle_text p span{ color: #999999;}
  15. #projectTitle .projectTitle_text i{ font-size: 22px; color: #cccccc; margin-left: 30px;}
  16. #projectTitle .projectTitle_img{ width: 200px; height: 149px; margin: 20px 20px 0 0;}
  17. #projectList .projectList_btns{ height: 54px; background: #f1f9fc; border-top: 1px #e0eaef solid;
  18. border-bottom: 1px #dbe7ed solid;}
  19. #projectList .projectList_btns ul{ margin: 14px 0 0 20px;}
  20. #projectList .projectList_btns li{ float: left; width: 108px; height: 39px; border: 1px solid #dbde7b;
  21. border-bottom: none; background: #fbfeff; color: #666666; text-align: center; line-height: 39px; margin-right: 12px;
  22. border-radius: 5px 5px 0 0; cursor: pointer;}
  23. #projectList .projectList_btns li .active{ color: white; background: #018ffb; position: relative;}
  24. #projectList .projectList_btns li .active ::after{ content: ""; display: block; position: absolute;
  25. width: 11px; height: 6px; background: url( "./zhimg/arrow.png") no-repeat; bottom: - 6px; left: 50%; margin-left: - 6px;}
  26. #projectList .projectList_cons{ margin: 20px;}
  27. #projectList .projectList_cons> div{ display: none;}
  28. #projectList .projectList_cons> div .show{ display: block;}
  29. #projectList .zl_upload1, #projectList .zl_upload2{ width: 110px; height: 32px; line-height: 32px;
  30. text-align: center; font-size: 14px; color: white; border-radius: 5px;}
  31. #projectList .zl_upload1 input, #projectList .zl_upload2 input{ display: none;}
  32. #projectList .zl_upload1 label, #projectList .zl_upload2 label{ cursor: pointer;}
  33. #projectList .zl_upload1{ background: #5FD15C;}
  34. #projectList .zl_upload2{ background: #34C1DA; margin-left: 20px;}
  35. #projectList .iconshangchuan1{ font-size: 12px; position: relative; top: - 1px;}
  36. #projectList .iconshangchuan2{ font-size: 12px;}
  37. #projectList .zl_search{ width: 210px; height: 30px; border: 1px solid #dbe7ed; border-radius: 5px;
  38. overflow: hidden;}
  39. #projectList .zl_search input{ border: none; width: 177px; height: 100%; color: #999999; font-size: 14px;
  40. text-indent: 9px; position: relative; top: - 3px; outline: none;}
  41. #projectList .zl_search button{ width: 32px; height: 32px; border: none; border-left: 1px #dbe7ed solid;
  42. background-image: linear-gradient(#FCFDFD,#F1F9FC);}
  43. #projectList .zl_search i{ font-size: 18px; font-weight: bold; color: #A1C6D4;}
  44. #projectList .zl_table{ clear: both; width: 100%; border: 1px solid #dbe7ed; font-size: 12px;
  45. border-collapse: collapse; position: relative; top: 20px;}
  46. #projectList .zl_table tr{ height: 32px; border-bottom: 1px solid #e7eff3;}
  47. #projectList .zl_table tr .hover{ background: #f1f9fc;}
  48. #projectList .zl_table th{ border-right: 1px #dbe7ed solid; color: #666666; font-weight: normal; text-align: left;
  49. text-indent: 18px; background: #f1f9fc;}
  50. #projectList .zl_table td{ text-indent: 12px;}
  51. #projectList .zl_table th :first-child, #projectList .zl_table td :first-child{ text-align: center; text-indent: 0;}
  52. #projectList .zl_table .iconword{ margin-right: 13px; color: #0173ca;}
  53. #projectList .zl_table .iconxiazai{ color: #3da2f0;}
  54. #projectList .zl_table .iconshanchushaixuanxiang{ color: #d94141;}
  55. #projectList .zl_footer{ height: 70px; border: 1px solid #dbde7b; border-top: none; margin-top: 20px; overflow: hidden;}
  56. #projectList .zl_remove , #projectList .zl_download{ width: 78px; height: 24px; border: 1px #c9e4f1 solid;
  57. border-radius: 3px; background-image: linear-gradient(#F7FCFF,#E4F4FA); margin-top: 18px;
  58. font-size: 12px; color: #1B84BA; cursor: pointer;}
  59. #projectList .zl_remove{ margin-right: 15px; margin-left: 22px;}
  60. #projectList .zl_page{ font-size: 12px; line-height: 24px; margin: 22px 18px 0 0; font-size: 0;}
  61. #projectList .zl_page a{ border: 1px solid #e6e6e6; padding: 6px 9px; font-size: 12px; margin-left: 10px;}
  62. #projectList .zl_page a .active{ border: 1px solid #3797e0; background: #42adff; color: white;}
  63. </style>
  64. </head>
  65. <body>
  66. <header id="header">
  67. <hgroup class="header_logo l">
  68. <h1 class="l">
  69. <img src="./zhimg/logo.png">
  70. </h1>
  71. <h2 class="l">正达建筑内部管理平台 </h2>
  72. </hgroup>
  73. <ul class="header_nav r">
  74. <li>
  75. <i class="iconfont iconwode"> </i>欢迎你:歌谣 管理员
  76. </li>
  77. <li>
  78. <i class="iconfont iconyuechi"> </i> <a href="#">修改密码 </a>
  79. </li>
  80. <li>
  81. <i class="iconfont iconshouye"> </i> <a href="#">公司官网 </a>
  82. </li>
  83. <li>
  84. <i class="iconfont iconplus-share"> </i> <a href="#">退出 </a>
  85. </li>
  86. </ul>
  87. </header>
  88. <aside id="menu" class="l">
  89. <ul>
  90. <li class="active">
  91. <a href="">
  92. <i class="iconfont iconloukongguanli"> </i> <p>项目管理 </p>
  93. </a>
  94. </li>
  95. <li>
  96. <a href="">
  97. <i class="iconfont iconyonghuxinxi"> </i> <p>用户管理 </p>
  98. </a>
  99. </li>
  100. <li>
  101. <a href="">
  102. <i class="iconfont iconshezhi"> </i> <p>系统设置 </p>
  103. </a>
  104. </li>
  105. </ul>
  106. </aside>
  107. <main id="main">
  108. <section class="main_container">
  109. <section id="projectTitle" class="clear">
  110. <div class="projectTitle_text l">
  111. <h2>晴天高玩绿源一期,二期工程 <i class="iconfont iconbianji"> </i> </h2>
  112. <p>
  113. 项目编号: <span>CN1111111 </span> <br>
  114. 项目类型: <span>在建工程 </span> <br>
  115. 项目负责人: <span>歌谣 </span> <br>
  116. 手机号码: <span>123413241542 </span> <br>
  117. </p>
  118. </div>
  119. <div class="projectTitle_img r">
  120. <img src="./zhimg/prpject.jpg">
  121. </div>
  122. </section>
  123. <section id="projectList">
  124. <div class="projectList_btns">
  125. <ul>
  126. <li>视频监控 </li>
  127. <li>考勤管理 </li>
  128. <li>安全巡查 </li>
  129. <li class="active">资料管理 </li>
  130. </ul>
  131. </div>
  132. <div class="projectList_cons">
  133. <div>视频监控1111 </div>
  134. <div>考情管理2222 </div>
  135. <div>我是歌谣3333 </div>
  136. <div class="show">
  137. <div class="zl_upload1 l">
  138. <label>
  139. <input type="file">
  140. <i class="iconfont iconshangchuan1"> </i> &nbsp; &nbsp; &nbsp;单个上传
  141. </label>
  142. </div>
  143. <div class="zl_upload2 l">
  144. <label>
  145. <input type="file" multiple>
  146. <i class="iconfiont iconshangchuan"> </i> &nbsp; &nbsp; &nbsp;批量上传
  147. </label>
  148. </div>
  149. <div class="zl_search r">
  150. <input type="text" placeholder="请输入关键字"> <button>
  151. <i class="iconfont iconsuosou"> </i>
  152. </button>
  153. </div>
  154. <table class="zl_table">
  155. <thead>
  156. <tr>
  157. <th width="49"> <input type="checkbox"> </th>
  158. <th>文档名称 </th>
  159. <th width="167">文档大小 </th>
  160. <th width="148">上传者 </th>
  161. <th width="168">上传时间 </th>
  162. <th width="81">操作 </th>
  163. </tr>
  164. <tbody>
  165. <tr>
  166. <td> <input type="checkbox"> </td>
  167. <td> <i class="iconfont iconword"> </i>安全专项方案.doc </td>
  168. <td>21.3kb </td>
  169. <td>歌谣 </td>
  170. <td>2016-03-14 </td>
  171. <td>
  172. <i class="iconfont iconxiazai"> </i> &nbsp; &nbsp; &nbsp;
  173. <i class="iconfont iconshanchushaixuanxiang"> </i>
  174. </td>
  175. </tr>
  176. <tr>
  177. <td> <input type="checkbox"> </td>
  178. <td> <i class="iconfont iconword"> </i>安全专项方案.doc </td>
  179. <td>21.3kb </td>
  180. <td>歌谣 </td>
  181. <td>2016-03-14 </td>
  182. <td>
  183. <i class="iconfont iconxiazai"> </i> &nbsp; &nbsp; &nbsp;
  184. <i class="iconfont iconshanchushaixuanxiang"> </i>
  185. </td>
  186. </tr>
  187. <tr>
  188. <td> <input type="checkbox"> </td>
  189. <td> <i class="iconfont iconword"> </i>安全专项方案.doc </td>
  190. <td>21.3kb </td>
  191. <td>歌谣 </td>
  192. <td>2016-03-14 </td>
  193. <td>
  194. <i class="iconfont iconxiazai"> </i> &nbsp; &nbsp; &nbsp;
  195. <i class="iconfont iconshanchushaixuanxiang"> </i>
  196. </td>
  197. </tr>
  198. <tr>
  199. <td> <input type="checkbox"> </td>
  200. <td> <i class="iconfont iconword"> </i>安全专项方案.doc </td>
  201. <td>21.3kb </td>
  202. <td>歌谣 </td>
  203. <td>2016-03-14 </td>
  204. <td>
  205. <i class="iconfont iconxiazai"> </i> &nbsp; &nbsp; &nbsp;
  206. <i class="iconfont iconshanchushaixuanxiang"> </i>
  207. </td>
  208. </tr>
  209. <tr>
  210. <td> <input type="checkbox"> </td>
  211. <td> <i class="iconfont iconword"> </i>安全专项方案.doc </td>
  212. <td>21.3kb </td>
  213. <td>歌谣 </td>
  214. <td>2016-03-14 </td>
  215. <td>
  216. <i class="iconfont iconxiazai"> </i> &nbsp; &nbsp; &nbsp;
  217. <i class="iconfont iconshanchushaixuanxiang"> </i>
  218. </td>
  219. </tr>
  220. <tr>
  221. <td> <input type="checkbox"> </td>
  222. <td> <i class="iconfont iconword"> </i>安全专项方案.doc </td>
  223. <td>21.3kb </td>
  224. <td>歌谣 </td>
  225. <td>2016-03-14 </td>
  226. <td>
  227. <i class="iconfont iconxiazai"> </i> &nbsp; &nbsp; &nbsp;
  228. <i class="iconfont iconshanchushaixuanxiang"> </i>
  229. </td>
  230. </tr>
  231. <tr>
  232. <td> <input type="checkbox"> </td>
  233. <td> <i class="iconfont iconword"> </i>安全专项方案.doc </td>
  234. <td>21.3kb </td>
  235. <td>歌谣 </td>
  236. <td>2016-03-14 </td>
  237. <td>
  238. <i class="iconfont iconxiazai"> </i> &nbsp; &nbsp; &nbsp;
  239. <i class="iconfont iconshanchushaixuanxiang"> </i>
  240. </td>
  241. </tr>
  242. <tr>
  243. <td> <input type="checkbox"> </td>
  244. <td> <i class="iconfont iconword"> </i>安全专项方案.doc </td>
  245. <td>21.3kb </td>
  246. <td>歌谣 </td>
  247. <td>2016-03-14 </td>
  248. <td>
  249. <i class="iconfont iconxiazai"> </i> &nbsp; &nbsp; &nbsp;
  250. <i class="iconfont iconshanchushaixuanxiang"> </i>
  251. </td>
  252. </tr>
  253. </tbody>
  254. </thead>
  255. </table>
  256. <div class="zl_footer">
  257. <button class="zl_remove">批量删除 </button>
  258. <button class="zl_download">批量下载 </button>
  259. <div class="zl_page r">
  260. <a href="#">共十二条 </a>
  261. <a href="#">首页 </a>
  262. <a href="#">上一页 </a>
  263. <a href="#" class="active">1 </a>
  264. <a href="#">2 </a>
  265. <a href="#">3 </a>
  266. <a href="#">下一页 </a>
  267. <a href="#">尾页 </a>
  268. </div>
  269. </div>
  270. </div>
  271. </div>
  272. </section>
  273. </section>
  274. </main>
  275. <footer id="footer">
  276. Copyright @ 2009 - 2016 阿里巴巴正达建筑工程有限公司 All rights reserved 技术支持:红点智能
  277. </footer>
  278. </body>
  279. </html>

commom,css


  
  1. *{ margin: 0; padding: 0;}
  2. ul{ list-style: none;}
  3. img{ display: block;}
  4. h1, h2, h3{ font-size: 16px; font-weight: normal;}
  5. a{ text-decoration: none; color: #333333;}
  6. html, body{ font-family: Arial, Helvetica, sans-serif; height: 100%; overflow-y: hidden;}
  7. .l{ float: left;}
  8. .r{ float: right;}
  9. .clear :after{ content: ""; display: block; clear: both;}
  10. #header{ height: 80px; background: #018ffb; border-top: 5px #424147 solid;}
  11. #header .header_logo{}
  12. #header .header_logo h1{ margin: 19px 14px 0 20px;}
  13. #header .header_logo h2{ color: white; font-size: 24px; line-height: 25px; margin-top: 28px;}
  14. #header .header_nav{ color: white; font-size: 14px; line-height: 14px; margin-top: 33px;}
  15. #header .header_nav li{ float: left; margin-right: 25px;}
  16. #header .header_nav i{ color: white; margin-right: 8px;}
  17. #header .header_nav a{ color: white;}
  18. #header .header_nav i .iconwode{ font-size: 24px; position: relative; top: 4px; line-height: 8px;}
  19. #header .header_nav i .iconshouye{ font-size: 20px; position: relative; top: 2px; line-height: 12px;}
  20. #menu{ width: 200px; background: #424147; height: calc( 100% - 85px);}
  21. #menu ul{ color: #9a999e; text-align: center;}
  22. #menu li{ height: 140px; border-bottom: 1px solid #3a393e; border-top: 1px solid #49484e;}
  23. #menu li .active{ color: white; background: #4e4d53;}
  24. #menu li a{ color: inherit; width: 100%; height: 100%; display: block; padding-top: 35px; box-sizing: border-box;}
  25. #menu li i{ font-size: 40px;}
  26. #menu li p{ margin-top: 15px;}
  27. #main{ overflow: hidden; height: calc( 100% - 85px - 50px);}
  28. #main .main_container{ height: 100%; overflow: auto;}
  29. #footer{ height: 49px; border-top: 1px solid #dbe72d; background: #f1f9fc; text-align: right; font-size: 12px;
  30. color: #888888; line-height: 49px; margin-right: 20px;}

2.6.1移动端拉勾网页面预览

2.6.2移动端拉勾网页面代码

昨晚pc端的开发 当然也要开始做做移动端的开发


  
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  7. <link rel="stylesheet" href="./iconfont1/">
  8. <title>移动端 </title>
  9. <link rel="stylesheet" href="./iconfont1/iconfont.css">
  10. <style>
  11. *{ margin: 0; padding: 0;}
  12. ul{ list-style: none;}
  13. img{ display: block;}
  14. a{ text-decoration: none; color: #333333;}
  15. header{ height: 45px; background: #00b38a; font-size: 20px; color: white;
  16. text-align: center; line-height: 45px;}
  17. .login{ height: 43px; display: flex; justify-content: space-between; align-items: center;
  18. font-size: 14px;}
  19. .login p{ margin-left: 16px;}
  20. .login div{ width: 84px; height: 30px; background: #f5f5f5; margin-right: 15px; text-align: center;
  21. line-height: 30px; border-radius: 15px;}
  22. .login div a{ display: block; width: 100%; height: 100%;}
  23. .list{}
  24. .list li{ height: 90px; border-top: 1px #e8e8e8 solid; display: flex; align-items: center;}
  25. .list .list_img{ width: 60px; margin: 0 10px 0 14px;}
  26. .list .list_img img{ width: 100%;}
  27. .list .list_info{ flex: 1;}
  28. .list .list_info h2{ font-size: 18px;}
  29. .list .list_info p :first-of-type{ font-size: 14px; display: flex; justify-content: space-between;}
  30. .list .list_info p :first-of-type span :last-of-type{ margin-right: 14px; color: #17b994;}
  31. .list .list_info p :last-of-type{ font-size: 12px; color: #888888; margin-top: 8px;}
  32. .more{ height: 50px; background: #fafafa; border-top: 1px #e8e8e8 solid; text-align: center;
  33. line-height: 50px;}
  34. .more a{ display: block; width: 100%; height: 100%;}
  35. footer{ height: 115px; text-align: center; font-size: 12px; line-height: 22px;
  36. padding-top: 27px; box-sizing: border-box; margin-bottom: 45px;}
  37. .tabber{ width: 100%; height: 45px; border-top: 1px #e8e8e8 solid; display: flex; position: fixed;
  38. bottom: 0; background: #f6f6f6; font-size: 18px; color: #c2cfcc;}
  39. .tabber i{ font-size: 22px; position: relative; top: 2px;}
  40. .tabber div{ flex: 1; text-align: center; line-height: 45px;}
  41. .tabber .active{ background: #e7f3f0; color: #00b38a;}
  42. </style>
  43. </head>
  44. <body>
  45. <header>拉勾网 </header>
  46. <section class="login">
  47. <p>十秒钟定制职位 </p>
  48. <div> <a href="#">去登陆 </a> </div>
  49. </section>
  50. <ul class="list">
  51. <li>
  52. <div class="list_img">
  53. <a href="#"> <img src="./lagou1.jpg"> </a>
  54. </div>
  55. <div class="list_info">
  56. <h2> <a href="">正大艾特 </a> </h2>
  57. <p>
  58. <span>中级java工程师 </span>
  59. <span>13k-20k </span>
  60. </p>
  61. <p>今天11:16 </p>
  62. </div>
  63. </li>
  64. </ul>
  65. <ul class="list">
  66. <li>
  67. <div class="list_img">
  68. <a href="#"> <img src="./lagou1.jpg"> </a>
  69. </div>
  70. <div class="list_info">
  71. <h2> <a href="">正大艾特 </a> </h2>
  72. <p>
  73. <span>中级java工程师 </span>
  74. <span>13k-20k </span>
  75. </p>
  76. <p>今天11:16 </p>
  77. </div>
  78. </li>
  79. </ul>
  80. <ul class="list">
  81. <li>
  82. <div class="list_img">
  83. <a href="#"> <img src="./lagou1.jpg"> </a>
  84. </div>
  85. <div class="list_info">
  86. <h2> <a href="">正大艾特 </a> </h2>
  87. <p>
  88. <span>中级java工程师 </span>
  89. <span>13k-20k </span>
  90. </p>
  91. <p>今天11:16 </p>
  92. </div>
  93. </li>
  94. </ul>
  95. <ul class="list">
  96. <li>
  97. <div class="list_img">
  98. <a href="#"> <img src="./lagou1.jpg"> </a>
  99. </div>
  100. <div class="list_info">
  101. <h2> <a href="">正大艾特 </a> </h2>
  102. <p>
  103. <span>中级java工程师 </span>
  104. <span>13k-20k </span>
  105. </p>
  106. <p>今天11:16 </p>
  107. </div>
  108. </li>
  109. </ul>
  110. <ul class="list">
  111. <li>
  112. <div class="list_img">
  113. <a href="#"> <img src="./lagou1.jpg"> </a>
  114. </div>
  115. <div class="list_info">
  116. <h2> <a href="">正大艾特 </a> </h2>
  117. <p>
  118. <span>中级java工程师 </span>
  119. <span>13k-20k </span>
  120. </p>
  121. <p>今天11:16 </p>
  122. </div>
  123. </li>
  124. </ul>
  125. <ul class="list">
  126. <li>
  127. <div class="list_img">
  128. <a href="#"> <img src="./lagou1.jpg"> </a>
  129. </div>
  130. <div class="list_info">
  131. <h2> <a href="">正大艾特 </a> </h2>
  132. <p>
  133. <span>中级java工程师 </span>
  134. <span>13k-20k </span>
  135. </p>
  136. <p>今天11:16 </p>
  137. </div>
  138. </li>
  139. </ul>
  140. <section class="more">
  141. <a href="">加载更多 </a>
  142. </section>
  143. <footer>
  144. <p>@2019 lan.com,all right reserved </p>
  145. <p>
  146. <a href="#">移动端 </a> ! <a href="#">移动端 </a> ! <a href="#">移动端 </a>
  147. </p>
  148. </footer>
  149. <section class="tabber">
  150. <div class="active"> <i class="iconfont icon-home"> </i> 职位 </div>
  151. <div> <i class="iconfont icon-sousuo-"> </i> 搜索 </div>
  152. <div> <i class="iconfont icon-wode"> </i> 我的 </div>
  153. </section>
  154. </body>
  155. </html>

2.7.1移动贺卡开发预览

本段代码总共有三个页面 也包括了一些简单js逻辑

2.7.2移动贺卡开发预览

index.html


  
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0,minimum-scale=1,
  6. maximum-scale=1,user-scalable=no">
  7. <meta name="format-detection" content="telephone=no">
  8. <meta http-equiv="X-UA-Compatible" content="chrome=1">
  9. <title>新春贺卡 </title>
  10. <link rel="stylesheet" type="text/css" href="./mooccss/style.css">
  11. </head>
  12. <body>
  13. <div class="music">
  14. <img src="./moocimg/music_pointer.png" alt="">
  15. <img class="play" id="music" src="./moocimg/music_disc.png" alt="">
  16. </div>
  17. <div class="page" id="page1">
  18. <div class="bg"> </div>
  19. <div class="p1_lantern">点击屏幕 <br>开启好运2020 </div>
  20. <div class="p1_imooc"> </div>
  21. <div class="p1_words">2020年歌谣新年特写 </div>
  22. </div>
  23. <div class="page" id="page2">
  24. <div class="p2_bg_loading"> </div>
  25. <div class="bg"> </div>
  26. <div class="p2_circle"> </div>
  27. <div class="p2_2016"> </div>
  28. </div>
  29. <div class="page" id="page3">
  30. <div class="bg"> </div>
  31. <div class="p3_logo"> </div>
  32. <div class="p3_title"> </div>
  33. <div class="p3_second"> </div>
  34. <div class="p3_first"> </div>
  35. <div class="p3_blessing"> </div>
  36. </div>
  37. <audio autoplay="true">
  38. <source src="./moocmusic/test.mp3" type="audio/mpeg">
  39. </audio>
  40. <script>
  41. window.onclick = function(){
  42. var page1= document.getElementById( "page1");
  43. var page2= document.getElementById( "page2");
  44. var page3= document.getElementById( "page3");
  45. var music = document.getElementById( "music");
  46. var audio = document.getElementsByTagName( "audio")[ 0];
  47. // 音乐结束自动自动停止
  48. audio.addEventListener( "ended", function(event){
  49. music.setAttribute( "class", "");
  50. }, false);
  51. // music.onclick = function(){
  52. // if(audio.paused){
  53. // audio.play();
  54. // this.setAttribute("class","play");
  55. // // this.style.animationPlayState="running";
  56. // // music.setAttribute("class","play");
  57. // }else{
  58. // audio.pause();
  59. // this.setAttribute("class","");
  60. // // music.setAttribute("class",""); this.style.animationPlayState="paused";
  61. // };
  62. // };
  63. music.addEventListener( "touchstart", function(event){
  64. if(audio.paused){
  65. audio.play();
  66. this.setAttribute( "class", "play");
  67. // this.style.animationPlayState="running";
  68. // music.setAttribute("class","play");
  69. } else{
  70. audio.pause();
  71. this.setAttribute( "class", "");
  72. // music.setAttribute("class",""); this.style.animationPlayState="paused";
  73. };
  74. }, false);
  75. // 页面翻页
  76. page1.addEventListener( "touchstart", function(event){
  77. page1.style.display= "none";
  78. page2.style.display= "block";
  79. page3.style.display= "block";
  80. page3.style.top= "100%";
  81. setTimeout( function(){
  82. page2.setAttribute( "class", "page fadeOut");
  83. page3.setAttribute( "class", "page fadeIn");
  84. }, 5500);
  85. }, false);
  86. };
  87. </script>
  88. </body>
  89. </html>

style.css


  
  1. *{ margin: 0; padding: 0; border: none; font-size: 1.5625vw; font-family: "Microsoft Yahei";}
  2. html, body{ height: 100%; overflow: hidden;}
  3. .music{ position: fixed; top: 3vh; right: 4vh; width: 15vw; height: 15vw; border: 4px solid #ef1639; z-index: 5; background: #fff; border-radius: 50%;}
  4. .music > img :first-of-type{ position: absolute; top: 24%; right: 2.5%; width: 28.421%; z-index: 1;}
  5. .music > img :last-of-type{ position: absolute; top: 0; right: 0; bottom: 0; left: 0; margin: auto; width: 79%; z-index: 0;}
  6. .music > img .play{
  7. -webkit-animation: music_disc 4s linear infinite;
  8. -o-animation: music_disc 4s linear infinite;
  9. animation: music_disc 4s linear infinite;
  10. }
  11. @keyframes music_disc{
  12. 0%{
  13. transform: rotate( 0deg);
  14. }
  15. 100%{
  16. transform: rotate( 360deg);
  17. }
  18. }
  19. .page { width: 100%; height: 100%; position: absolute;}
  20. .page > .bg { position: absolute; width: 100%; height: 100%; z-index: - 1;}
  21. #page1{ display: block;}
  22. #page1 > .bg{ background: url( "../moocimg/p1_bg.jpg") no-repeat center center;
  23. background-size: 100%;}
  24. #page1 > .p1_lantern{ position: absolute; top: - 3.4%; right: 0; left: 0; margin: auto; width: 45vw; height: 71.2vh; background: url( "../moocimg/p1_lantern.png") no-repeat center bottom;
  25. font-size: 3.506rem; background-size: 100%; padding-top: 31vh; color: #fff;
  26. box-sizing: border-box; text-align: center; animation: p1_lantern . 5s infinite alternate;}
  27. @keyframes p1_lantern{
  28. 0%{ opacity: . 5;
  29. transform: scale(. 8,. 8);
  30. }
  31. 100%{ opacity: 1;}
  32. }
  33. #page1 > .p1_lantern ::before{ position: absolute; top: 0; right: 0; bottom: 0; left: 0; margin: auto; width: 30vw; height: 30vw; background: #d60b5b; opacity: . 5; box-shadow: 0 0 10vw 10vw #d60b5b; z-index: - 1; content: ""; border-radius: 50%;}
  34. #page1 > .p1_imooc{ position: absolute; right: 0; bottom: 9vh; left: 0; background: url( "../moocimg/p1_imooc.png") no-repeat center center; background-size: 100%; width: 27.656vw; height: 18.63vh; margin: auto;}
  35. #page1 > .p1_words{ font-size: 2.134rem; position: absolute; left: 0; right: 0; bottom: 48px; text-align: center; color: #231815;}
  36. #page2{ display: none; transition: . 5s;}
  37. #page2 .p2_bg_loading{ z-index: 4; background: #ef1639;
  38. animation: p2_bg_loading 1s linear forwards;}
  39. @keyframes p2_bg_loading{
  40. 0%{ opacity: 1;}
  41. 100%{ opacity: 0;}
  42. }
  43. #page2 .fadeOut{ opacity: . 3;
  44. transform: translate( 0.- 100%);}
  45. #page2 > .bg{ background: url( "../moocimg/p2_bg.jpg") no-repeat center center;
  46. background-size: 100%;}
  47. #page2 > .p2_circle ::before{ position: absolute; top: 0; right: 0; left: 0; bottom: 0; margin: auto; content: ""; background: url( "../moocimg/p2_circle_middle.png") no-repeat center center; background-size: 100%; width: 45.625vw; height: 45.625vw; border-radius: 50%;
  48. animation: p2_circle_middle 1s linear 2s infinite;}
  49. #page2 > .p2_circle ::after{ position: absolute; top: 0; right: 0; left: 0; bottom: 0; margin: auto; content: ""; background: url( "../moocimg/p2_circle_inner.png") no-repeat center center;
  50. background-size: 100%; width: 39.937vw; height: 39.937vw; border-radius: 50%;
  51. animation: p2_circle_inner 1s linear 1s infinite;
  52. }
  53. @keyframes p2_circle_inner{
  54. 0%{
  55. transform: rotate( 0deg);
  56. }
  57. 100%{
  58. transform: rotate(- 1080deg);
  59. }
  60. }
  61. @keyframes p2_circle_middle{
  62. 0%{
  63. transform: rotate( 0deg);
  64. }
  65. 100%{
  66. transform: rotate(- 720deg);
  67. }
  68. }
  69. #page2 > .p2_circle{ position: absolute; top: 0; right: 0; left: 0; bottom: 0; margin: auto; background: url( "../moocimg/p2_circle_outer.png") no-repeat center center; background-size: 100%; width: 59.375vw; height: 59.375vw; border-radius: 50%; animation: p2_circle_outer 1s linear 3s infinite;}
  70. @keyframes p2_circle_outer{
  71. 0%{
  72. transform: rotate( 0deg);
  73. }
  74. 100%{
  75. transform: rotate(- 360deg);
  76. }
  77. }
  78. #page2 > .p2_2016{ position: absolute; top: 0; right: 0; left: 0; bottom: 0; margin: auto; background: url( "../moocimg/p2_2016.png") no-repeat center center; background-size: 100%; width: 27.5vw; height: 6.24vh;}
  79. #page3{ display: none; transition: . 5s;}
  80. #page3 .fadeIn{ transform: translate( 0,- 100%);}
  81. #page3 > .bg{ background: url( "../moocimg/p3_bg.jpg") no-repeat center center;
  82. background-size: 100%;}
  83. #page3> .p3_logo{ width: 34.6875vw; height: 6.327vh; position: absolute; top: 7.82vh; right: 0;
  84. left: 0; background: url( "../moocimg/p3_logo.png") no-repeat center center; background-size: 100%; margin: auto;}
  85. #page3> .p3_title{ width: 48.125vw; height: 50vh; position: absolute; top: 21vh; right: 0;
  86. left: 0; background: url( "../moocimg/p3_title.png") no-repeat center center; background-size: 100%; margin: auto;}
  87. #page3> .p3_second{ width: 22.8125vw; height: 41.625vh; position: absolute; top: 25.48vh; left: 3.75vw; background: url( "../moocimg/p3_couplet_second.png") no-repeat center center; background-size: 100%; margin: auto;}
  88. #page3> .p3_first{ width: 22.8125vw; height: 41.625vh; position: absolute; top: 25.48vh; right: 3.75vw; background: url( "../moocimg/p3_couplet_first.png") no-repeat center center; background-size: 100%; margin: auto;}
  89. #page3> .p3_blessing{ width: 32vw; height: 32vw; position: absolute; bottom: 10vh; right: 0;
  90. left: 0; background: url( "../moocimg/p3_blessing.png") no-repeat center center; background-size: 100%; border-radius: 50%; margin: auto;
  91. animation: p3_blessing 2s linear infinite;}
  92. @keyframes p3_blessing{
  93. 0%{
  94. transform: rotate( 0deg);
  95. }
  96. 100%{
  97. transform: rotate( 360deg);
  98. }
  99. }
  100. /* 特效 */

2.8.1京东网页页面预览

书写页面怎么能不写京东淘宝等一些页面的实现呢 作为学习者 这些应该都是我们模仿的对象

2.8.2京东网页页面代码

由于本页面代码过多 分为头部中部尾部样式 分开来写 就不全部复制


  
  1. <! DOCTYPE html>
  2. < html lang=" en">
  3. < head>
  4. < meta charset=" UTF-8">
  5. < meta name=" viewport" content=" width= device-width, initial-scale=1 .0">
  6. < meta http-equiv=" X-UA-Compatible" content=" ie= edge">
  7. < title>京东 JD .COM官网 多快好省 只为品质生活</ title>
  8. <! -- 引入京东小图标 -->
  9. < link rel=" shortcut icon" href=" favicon .ico" type=" image/ x-icon">
  10. <! -- 重置样式 -->
  11. < link rel=" stylesheet" href="./ jingdongcss/ normalize .css">
  12. <! -- 头部和尾部基本相同 公共样式 -->
  13. < link rel=" stylesheet" href="./ jingdongcss/ base .css">
  14. < link rel=" stylesheet" href="./ jingdongfont/ ie7 .css">
  15. < link rel=" stylesheet" href="./ jingdongcss/ index .css">
  16. < meta name=" description" content="京东 JD .COM-专业综合网上购物商城,销售超数万品牌,4020万种商品,囊括家电、手机、电脑、服装、居家、母婴、美妆、个护、食品、旅游等13大品类。京东 PLUS会员,免费体验30天!京东秉承客户为先, 100%正品行货保障,提供全国联保,机打发票,专业配送,售后服务!"/>
  17. < meta name=" keywords" content="网上购物,网上商城,手机,笔记本,电脑,相机,数码,手表,存储卡,京东"/>
  18. </ head>
  19. < body>
  20. <! -- 头部开始 -->
  21. < header>
  22. < div class=" w">
  23. < a href="">
  24. < img src="./ jingdongimg/ header .jpg" alt="">
  25. </ a>
  26. </ div>
  27. </ header>
  28. <! -- 头部结束 -->
  29. <! -- 快速导航栏 -->
  30. < div class=" shortcut">
  31. < div class=" w">
  32. < ul class=" fl city">
  33. < li>< i class=" f10"></ i>< a href="#">北京</ a></ li>
  34. </ ul>
  35. < ul class=" fr">
  36. < li>
  37. < a href="#">你好,请登录</ a>
  38. < a href="#" class=" f10">免费注册</ a>
  39. </ li>
  40. < li class=" space"></ li>
  41. < li>
  42. < a href="#">我的订单</ a>
  43. </ li>
  44. < li class=" space"></ li>
  45. < li>
  46. < a href="#">我的京东</ a>
  47. < i></ i>
  48. </ li>
  49. < li class=" space"></ li>
  50. < li>
  51. < a href="#">京东会员</ a>
  52. </ li>
  53. < li class=" space"></ li>
  54. < li>
  55. < a href="#">企业采购</ a>
  56. </ li>
  57. < li class=" space"></ li>
  58. < li>
  59. < a href="#">客户服务</ a>
  60. < i></ i>
  61. </ li>
  62. < li class=" space"></ li>
  63. < li>
  64. < a href="#">网站导航</ a>
  65. < i></ i>
  66. </ li>
  67. < li class=" space"></ li>
  68. < li>
  69. < a href="#" class=" moblie">手机京东
  70. < img src="./ jingdongimg/ mobile .png" alt="">
  71. </ a>
  72. </ li>
  73. </ ul>
  74. </ div>
  75. </ div>
  76. <! -- 快速导航栏结束 -->
  77. <! -- 中间部分 -->
  78. < div class=" w middle">
  79. < div class=" logo">
  80. <! -- 提高权重,提高搜索引擎优化 -->
  81. < h1>
  82. < a href="#"></ a>
  83. </ h1>
  84. </ div>
  85. <! -- 搜索框 -->
  86. < div class=" form">
  87. < input type=" text" placeholder="扫描仪">
  88. <! -- 按钮的意思,双标签 -->
  89. < button>< i></ i></ button>
  90. </ div>
  91. <! -- 购物车 -->
  92. < div class=" shopCar">
  93. < i></ i>
  94. < a href="#" class=" f10">我的购物车</ a>< span>0</ span>
  95. </ div>
  96. <! -- 关键字 -->
  97. < div class=" hotwords">
  98. < a href="#" class=" f10">199减100</ a>
  99. < a href="#">鼠标试用</ a>
  100. < a href="#">农资7折</ a>
  101. < a href="#">低至29元</ a>
  102. < a href="#">抽奖赢空调</ a>
  103. < a href="#">记忆棉</ a>
  104. < a href="#">坐垫</ a>
  105. < a href="#">1分钱买油</ a>
  106. < a href="#">智能手表</ a>
  107. </ div>
  108. <! -- 小导航部分 -->
  109. < div class=" navitems">
  110. < ul>
  111. < li>
  112. < a href="#">秒杀</ a>
  113. </ li>
  114. < li>
  115. < a href="#">优惠券</ a>
  116. </ li>
  117. < li>
  118. < a href="#">闪购</ a>
  119. </ li>
  120. < li>
  121. < a href="#">拍卖</ a>
  122. </ li>
  123. < li class=" space"></ li>
  124. < li>
  125. < a href="#">服装城</ a>
  126. </ li>
  127. < li>
  128. < a href="#">京东超市</ a>
  129. </ li>
  130. < li>
  131. < a href="#">生鲜</ a>
  132. </ li>
  133. < li>
  134. < a href="#">全球购</ a>
  135. </ li>
  136. < li class=" space"></ li>
  137. < li>
  138. < a href="#">京东金融</ a>
  139. </ li>
  140. </ ul>
  141. </ div>
  142. </ div>
  143. <! -- 中间部分结束 -->
  144. <! -- 中间部分 开始 -->
  145. < div class=" w grid">
  146. < div class=" grid-coll1 fl">
  147. < div class=" ad">
  148. < img src="./ jingdongimg/ ad-l .png" height="480" width="250" alt="">
  149. < img src="./ jingdongimg/ ad-r .jpg" class=" ad-r">
  150. </ div>
  151. < ul>
  152. < li>< a href="#">家用电器</ a></ li>
  153. < li>< a href="#">手机</ a>/< a href="#">运用商</ a>/< a href="#">数码</ a></ li>
  154. < li>< a href="#">手机</ a>/< a href="#">运用商</ a>/< a href="#">数码</ a></ li>
  155. < li>< a href="#">手机</ a>/< a href="#">运用商</ a>/< a href="#">数码</ a></ li>
  156. < li>< a href="#">手机</ a>/< a href="#">运用商</ a>/< a href="#">数码</ a></ li>
  157. < li>< a href="#">手机</ a>/< a href="#">运用商</ a>/< a href="#">数码</ a></ li>
  158. < li>< a href="#">手机</ a>/< a href="#">运用商</ a>/< a href="#">数码</ a></ li>
  159. < li>< a href="#">手机</ a>/< a href="#">运用商</ a>/< a href="#">数码</ a></ li>
  160. < li>< a href="#">手机</ a>/< a href="#">运用商</ a>/< a href="#">数码</ a></ li>
  161. < li>< a href="#">手机</ a>/< a href="#">运用商</ a>/< a href="#">数码</ a></ li>
  162. < li>< a href="#">手机</ a>/< a href="#">运用商</ a>/< a href="#">数码</ a></ li>
  163. < li>< a href="#">手机</ a>/< a href="#">运用商</ a>/< a href="#">数码</ a></ li>
  164. < li>< a href="#">手机</ a>/< a href="#">运用商</ a>/< a href="#">数码</ a></ li>
  165. < li>< a href="#">图像</ a>/< a href="#">音响</ a>/< a href="#">电子书</ a></ li>
  166. < li>< a href="#">手机</ a>/< a href="#">运用商</ a>/< a href="#">数码</ a></ li>
  167. < li>< a href="#">理财</ a>/< a href="#">众筹</ a>/< a href="#">白条</ a>/< a href="#">保险</ a></ li>
  168. </ ul>
  169. </ div>
  170. < div class=" grid-coll2 fl">
  171. < div class=" coll2-t">
  172. < a href="#">< img src="./ jingdongimg/ banner .jpg" height="340" width="790" alt=""></ a>
  173. < a href="#" class=" arrow-l"><</ a>
  174. < a href="#" class=" arrow-r">></ a>
  175. < ul class=" circle">
  176. < li></ li>
  177. < li></ li>
  178. < li></ li>
  179. < li class=" current"></ li>
  180. < li></ li>
  181. < li></ li>
  182. < li></ li>
  183. < li></ li>
  184. </ ul>
  185. </ div>
  186. < div class=" coll2-b">
  187. < div>
  188. < img src="./ jingdongimg/ l .jpg" height="130" width="390" alt="">
  189. </ div>
  190. < div>
  191. < img src="./ jingdongimg/ r .jpg" height="130" width="390" alt="">
  192. </ div>
  193. </ div>
  194. </ div>
  195. < div class=" grid-coll3 fr">
  196. < div class=" login">
  197. < div class=" login-t">
  198. Hi,欢迎来到京东< br>
  199. < a href="#">登录</ a>
  200. < a href="#">注册</ a>
  201. < a href="#" class=" user-info">
  202. < img src="./ jingdongimg/ no_login .jpg" alt="">
  203. </ a>
  204. </ div>
  205. < div class=" login-b">
  206. < a href="#">新人福利</ a>
  207. < a href="#"> plus会员</ a>
  208. </ div>
  209. </ div>
  210. < div class=" news">
  211. < div class=" news-t">
  212. < a href="#" class=" cuxiao">促销</ a>
  213. < a href="#" class=" gg">公告</ a>
  214. < a href="#" class=" more">更多</ a>
  215. < div></ div>
  216. </ div>
  217. < div class=" news-b">
  218. < ul>
  219. < li>< a href="">挑战三天不洗头</ a></ li>
  220. < li>< a href="">挑战三天不洗头</ a></ li>
  221. < li>< a href="">挑战三天不洗头</ a></ li>
  222. < li>< a href="">挑战三天不洗头,我是歌</ a></ li>
  223. </ ul>
  224. </ div>
  225. </ div>
  226. < div class=" expand">
  227. < ul>
  228. < li>
  229. < a href="#">
  230. < i></ i>
  231. < span>话费</ span>
  232. </ a>
  233. </ li>
  234. < li>
  235. < a href="#">
  236. < i></ i>
  237. < span>话费</ span>
  238. </ a>
  239. </ li>
  240. < li>
  241. < a href="#">
  242. < i></ i>
  243. < span>话费</ span>
  244. </ a>
  245. </ li>
  246. < li>
  247. < a href="#">
  248. < i></ i>
  249. < span>话费</ span>
  250. </ a>
  251. </ li>
  252. < li>
  253. < a href="#">
  254. < i></ i>
  255. < span>话费</ span>
  256. </ a>
  257. </ li>
  258. < li>
  259. < a href="#">
  260. < i></ i>
  261. < span>话费</ span>
  262. </ a>
  263. </ li>
  264. < li>
  265. < a href="#">
  266. < i></ i>
  267. < span>话费</ span>
  268. </ a>
  269. </ li>
  270. < li>
  271. < a href="#">
  272. < i></ i>
  273. < span>话费</ span>
  274. </ a>
  275. </ li>
  276. < li>
  277. < a href="#">
  278. < i></ i>
  279. < span>话费</ span>
  280. </ a>
  281. </ li>
  282. < li>
  283. < a href="#">
  284. < i></ i>
  285. < span>话费</ span>
  286. </ a>
  287. </ li>
  288. < li>
  289. < a href="#">
  290. < i></ i>
  291. < span>话费</ span>
  292. </ a>
  293. </ li>
  294. < li>
  295. < a href="#">
  296. < i></ i>
  297. < span>话费</ span>
  298. </ a>
  299. </ li>
  300. </ ul>
  301. </ div>
  302. </ div>
  303. </ div>
  304. <! -- 中间部分 结束 -->
  305. <! -- 页面底部部分 -->
  306. < footer>
  307. < div class=" service">
  308. < div class=" w">
  309. < ul>
  310. < li>
  311. < h5>多</ h5>
  312. < p>品类齐全,轻松购物</ p>
  313. </ li>
  314. < li>
  315. < h5>多</ h5>
  316. < p>品类齐全,轻松购物</ p>
  317. </ li>
  318. < li>
  319. < h5>多</ h5>
  320. < p>品类齐全,轻松购物</ p>
  321. </ li>
  322. < li>
  323. < h5>多</ h5>
  324. < p>品类齐全,轻松购物</ p>
  325. </ li>
  326. </ ul>
  327. </ div>
  328. </ div>
  329. <! -- 帮助模块 -->
  330. < div class=" w help">
  331. < div class=" fl">
  332. < dl>
  333. < dt>购物指南</ dt>
  334. < dd>< a href="#">购物流程</ a></ dd>
  335. < dd>< a href="#">会员介绍</ a></ dd>
  336. < dd>< a href="#">购物流程</ a></ dd>
  337. < dd>< a href="#">购物流程</ a></ dd>
  338. < dd>< a href="#">购物流程</ a></ dd>
  339. < dd>< a href="#">购物流程</ a></ dd>
  340. </ dl>
  341. < dl>
  342. < dt>购物指南</ dt>
  343. < dd>< a href="#">购物流程</ a></ dd>
  344. < dd>< a href="#">会员介绍</ a></ dd>
  345. < dd>< a href="#">购物流程</ a></ dd>
  346. < dd>< a href="#">购物流程</ a></ dd>
  347. < dd>< a href="#">购物流程</ a></ dd>
  348. < dd>< a href="#">购物流程</ a></ dd>
  349. </ dl>
  350. < dl>
  351. < dt>购物指南</ dt>
  352. < dd>< a href="#">购物流程</ a></ dd>
  353. < dd>< a href="#">会员介绍</ a></ dd>
  354. < dd>< a href="#">购物流程</ a></ dd>
  355. < dd>< a href="#">购物流程</ a></ dd>
  356. < dd>< a href="#">购物流程</ a></ dd>
  357. < dd>< a href="#">购物流程</ a></ dd>
  358. </ dl>
  359. < dl>
  360. < dt>购物指南</ dt>
  361. < dd>< a href="#">购物流程</ a></ dd>
  362. < dd>< a href="#">会员介绍</ a></ dd>
  363. < dd>< a href="#">购物流程</ a></ dd>
  364. < dd>< a href="#">购物流程</ a></ dd>
  365. < dd>< a href="#">购物流程</ a></ dd>
  366. < dd>< a href="#">购物流程</ a></ dd>
  367. </ dl>
  368. < dl>
  369. < dt>购物指南</ dt>
  370. < dd>< a href="#">购物流程</ a></ dd>
  371. < dd>< a href="#">会员介绍</ a></ dd>
  372. < dd>< a href="#">购物流程</ a></ dd>
  373. < dd>< a href="#">购物流程</ a></ dd>
  374. < dd>< a href="#">购物流程</ a></ dd>
  375. < dd>< a href="#">购物流程</ a></ dd>
  376. </ dl>
  377. </ div>
  378. < div class=" fr coverage">
  379. < h5>京东自营点歌谣小区</ h5>
  380. < p>京东开始向9999个社区进行自配营业服务,支持货到付款,各种方式支付和远程协助服务</ p>
  381. < a href="#">查看详情</ a>
  382. </ div>
  383. </ div>
  384. <! -- 版权部分 -->
  385. < div class=" w copyright">
  386. < p>< a href="#">关于我们</ a>
  387. < span> | </ span>
  388. < a href="#">关于我们</ a>
  389. < span> | </ span>
  390. < a href="#">关于我们</ a>
  391. < span> | </ span>
  392. < a href="#">关于我们</ a>
  393. < span> | </ span>
  394. < a href="#">关于我们</ a>
  395. < span> | </ span>
  396. < a href="#">关于我们</ a>
  397. < span> | </ span>
  398. < a href="#">关于我们</ a>
  399. < span> | </ span>
  400. < a href="#">关于我们</ a>
  401. < span> | </ span>
  402. < a href="#">关于我们</ a>
  403. < span> | </ span>
  404. < a href="#">关于我们</ a>
  405. < span> | </ span>
  406. < a href="#">关于我们</ a>
  407. < span> | </ span>
  408. < a href="#">关于我们</ a>
  409. < span> | </ span>
  410. </ p>
  411. < div>
  412. < p>京公网安备 11000002000088号< span>|</ span>京 ICP证070359号< span>|</ span>互联网药品信息服务资格证编号(京) -经营性 -2014-0008< span>|</ span>新出发京零 字第大120007号</ p>
  413. < p>互联网出版许可证编号新出网证(京)字150号< span>|</ span>出版物经营许可证< span>|</ span>网络文化经营许可证京网文 [2014]2148 -348号< span>|</ span>违法和不良信息举报电话:4006561155</ p>
  414. < p> Copyright © 2004 - 2017 京东 JD .com 版权所有|消费者维权热线:4006067733经营证照
  415. 京东旗下网站:京东支付|京东云</ p>
  416. </ div>
  417. < p class=" font-icon">
  418. < a href="#"></ a>
  419. < a href="#"></ a>
  420. < a href="#"></ a>
  421. < a href="#"></ a>
  422. < a href="#"></ a>
  423. < a href="#"></ a>
  424. </ p>
  425. </ div>
  426. </ footer>
  427. <! -- 页面底部部分 -->
  428. </ body>
  429. </ html>

3网页进阶版(框架)

当你进入一个公司的时候 简单版的样式编写已经无法满足你得要求 你要参照原型图进行页面设计的开发和预览

3.1.1网上月经周期代码

这是pc端的代码 我所需要的是按照实际的业务需求给他转换为移动端代码

3.1.2网上月经周期重构

3.1.3网上月经周期页面代码

当你在工作中参照一些样式进行开发 并进行完美复原 那么你就开始在成长的路上了

axios+Vant+vue+jq重构jq月经周期计算器源代码(兼容移动端)

贴出一部分代码


  
  1. <head>
  2. <meta charset="UTF-8">
  3. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
  4. <!-- 引入样式文件 -->
  5. <link rel="stylesheet" href="./css/index.css" />
  6. <!-- 引入 Vue 和 Vant 的 JS 文件 -->
  7. <script src="./js/vue.js"> </script>
  8. <script src="./js/vant.js"> </script>
  9. <script type="text/javascript" src="./js/jquery-1.7.2.js"> </script>
  10. <script src="./js/axios.js"> </script>
  11. <script type="text/javascript" src="js/index.js"> </script>
  12. <title>萌芽APP </title>
  13. <style>
  14. body {
  15. width: 100%;
  16. }
  17. .SetTime {
  18. width: 100%;
  19. height: 40px;
  20. background: #F6F7F9;
  21. opacity: 1;
  22. }
  23. span {
  24. margin-left: 12px;
  25. width: 286px;
  26. height: 37px;
  27. font-size: 13px;
  28. font-family: PingFang SC;
  29. font-weight: 400;
  30. line-height: 30px;
  31. color: #333333;
  32. opacity: 1;
  33. line-height: 40px;
  34. }
  35. .SetDate {
  36. width: 100%;
  37. display: block;
  38. }
  39. input [type="date"] {
  40. box-sizing: border-box;
  41. text-align: center;
  42. font-size: 1.4em;
  43. height: 2.7em;
  44. border-radius: 4px;
  45. border: 1px solid #c8cccf;
  46. color: #6a6f77;
  47. -web-kit-appearance: none;
  48. -moz-appearance: none;
  49. display: block;
  50. outline: 0;
  51. padding: 0 1em;
  52. text-decoration: none;
  53. width: 100%;
  54. }
  55. input [type="date"] :focus {
  56. border: 1px solid #ff7496;
  57. }
  58. input [type="number"] {
  59. box-sizing: border-box;
  60. text-align: center;
  61. font-size: 1.4em;
  62. height: 2.7em;
  63. border-radius: 4px;
  64. border: 1px solid #c8cccf;
  65. color: #6a6f77;
  66. -web-kit-appearance: none;
  67. -moz-appearance: none;
  68. display: block;
  69. outline: 0;
  70. padding: 0 1em;
  71. text-decoration: none;
  72. width: 100%;
  73. }
  74. input [type="number"] :focus {
  75. border: 1px solid #ff7496;
  76. }
  77. input [type="button"] {
  78. box-sizing: border-box;
  79. text-align: center;
  80. font-size: 1.4em;
  81. height: 2.7em;
  82. border-radius: 4px;
  83. border: 1px solid #c8cccf;
  84. color: #6a6f77;
  85. -web-kit-appearance: none;
  86. -moz-appearance: none;
  87. display: block;
  88. outline: 0;
  89. padding: 0 1em;
  90. text-decoration: none;
  91. width: 100%;
  92. }
  93. .SetButton {
  94. width: 50%;
  95. left: 25%;
  96. margin-top: 20px;
  97. text-align: center;
  98. }
  99. .button{
  100. bottom: - 100px;
  101. display: block;
  102. margin: 0 auto;
  103. width: 140px;
  104. height: 45px;
  105. background: #FFA9B5;
  106. opacity: 1;
  107. border-radius: 78px;
  108. border: none;
  109. font-size: 17px;
  110. font-family: PingFang SC;
  111. font-weight: 400;
  112. line-height: 5px;
  113. color: #FFFFFF;
  114. opacity: 1;
  115. }
  116. .van-picker-column{
  117. font-size: 24px;
  118. }
  119. </style>
  120. </head>
  121. <body>
  122. <div id="app" style="position: relative">
  123. <div class="SetTime">
  124. <span>你最近来月经的日期是 </span>
  125. </div>
  126. <div class="SetDate">
  127. <van-field @focus="SetTimeShow" ref="ScanTextBox" v-model="form.SetTime" placeholder="请输入日期" />
  128. </div>
  129. <van-popup position="bottom" style="width:100%" v-model="show">
  130. <van-datetime-picker class="van-picker-column" v-model="currentDate" @confirm="DataSelect" type="date" title="选择年月日" :min-date="minDate" :max-date="maxDate" />
  131. </van-popup>
  132. <div class="SetTime">
  133. <span>月经持续天数(天) </span>
  134. </div>
  135. <div class="SetDate">
  136. <van-field @focus="SetDateShow" ref="ScanTextBox1" v-model="form.KeepTime" placeholder="请输入天数" />
  137. </div>
  138. <div class="SetTime">
  139. <span>月经周期(天) </span>
  140. </div>
  141. <div class="SetDate">
  142. <van-field @focus="SetDateShow1" ref="ScanTextBox2" v-model="form.WeekTime" placeholder="请输入周期" />
  143. </div>
  144. <!-- <button class="button" @click="submit">确定</button>-->
  145. <!-- <input type="button" style="display: block;width: 100px;height:100px;margin: 0 auto;border-radius: 50%;background: #E7659D;color: white;" value="确定" @click="submit" >-->
  146. <button class="button" round class="SetButton" type="info" color="#ff7496" @click="submit">
  147. &nbsp; &nbsp;
  148. </button>
  149. <van-popup position="bottom" style="width:100%" v-model="show1">
  150. <van-picker title="持续天数" show-toolbar class="van-picker-column" :columns="columns" @confirm="onConfirm" @cancel="onCancel" @change="onChange" placeholder="请输入天数" />
  151. </van-popup>
  152. <van-popup position="bottom" style="width:100%;" v-model="show2">
  153. <van-picker title="月经周期" class="van-picker-column" show-toolbar :columns="columns1" @confirm="onConfirm1" @cancel="onCancel" @change="onChange" placeholder="请输入天数" />
  154. </van-popup>
  155. <!-- <van-button type="primary" @click="toNotify" class="btn">顶部通知</van-button>-->
  156. </div>
  157. </body>
  158. <script>
  159. // 在 #app 标签下渲染一个按钮组件
  160. new Vue({
  161. el: '#app',
  162. data() {
  163. return {
  164. minDate: new Date( 2020, 0, 1),
  165. maxDate: new Date(),
  166. currentDate: new Date(),
  167. /*定义日期的显示*/
  168. show: false,
  169. /*定义月经周期的显示*/
  170. show1: false,
  171. /*定义时间的显示*/
  172. show2: false,
  173. form: {
  174. KeepTime: 5,
  175. WeekTime: 28,
  176. SetTime: new Date()
  177. },
  178. bzDate: '',
  179. /*定于月经周期的选择框*/
  180. columns1: []
  181. /*定义时间周期的选择框*/,
  182. columns: [],
  183. };
  184. },
  185. watch: {
  186. form: {
  187. handler(newName, oldName) {
  188. console.log(newName)
  189. },
  190. immediate: true,
  191. deep: true
  192. }
  193. },
  194. created(){
  195. var d = new Date();
  196. let dateYear = d.getFullYear(); //获取年
  197. getAction( "/menstrual/historyListByYear"+dateYear).then( res=>{
  198. console.log(res, "res")
  199. })
  200. let dateMonth = d.getMonth() + 1 < 10 ? '0' + (d.getMonth() + 1) : d.getMonth() + 1; //获取月
  201. let dateDate = d.getDate() < 10 ? '0' + d.getDate() : new Date(d).getDate(); //获取当日
  202. this.form.SetTime = dateYear + "-" + dateMonth + "-" + dateDate
  203. this.columns=[]
  204. this.columns1=[]
  205. for( var i= 1;i<= 90;i++){
  206. this.columns.push(i)
  207. }
  208. console.log( this.columns1, "columns1")
  209. for( var i= 1;i<= 365;i++){
  210. this.columns1.push(i)
  211. }
  212. },
  213. methods: {
  214. /* toChangeDate(date) {
  215. console.log(new Date(date).getFullYear())
  216. console.log(new Date(date).getMonth())
  217. console.log(new Date(date).getDay())
  218. let dateYear = new Date(date).getFullYear(); //获取年
  219. let dateMonth = new Date(date).getMonth() + 1 < 10 ? '0' + new Date(e).getMonth() : new Date(e).getMonth(); //获取月
  220. let dateDate = new Date(date).getDate() < 10 ? '0' + new Date(e).getDate() : new Date(e).getDate(); //获取当日
  221. return dateYear + '-' + dateMonth + '-' +
  222. dateDate
  223. }, */
  224. async submit() {
  225. /* let SetTimeOut=new Date(this.form.SetTime)*/
  226. await postAction( "/menstrual/basicsAddOrUpdate?firstDate=" +
  227. this.form.SetTime + "&continuousDays=" + this.form.KeepTime + "&cycleNumber=" + this.form.WeekTime
  228. ).then( res => {
  229. console.log(res)
  230. var Request = new Object();
  231. Request = this.GetRequest();
  232. let token=Request.token
  233. if ( this.noNull( this.form.SetTime) && this.noNull( this.form.KeepTime) && this.noNull( this.form.WeekTime)) {
  234. /*http://114.215.149.84:8086/*/
  235. window.location.href = "./index.html?lastDate=" + this.bzDate + "&keepDate="
  236. + this.form.KeepTime + "&weekDate=" + this.form.WeekTime+ "&token="+token;
  237. } else {
  238. this.$toast.success( "当前所填项不能为空")
  239. }
  240. })
  241. },
  242. toNotify() {
  243. },
  244. /*点击确定之后触发的点击事件*/
  245. GetRequest() {
  246. var url = location.search; //获取url中"?"符后的字串
  247. var theRequest = new Object();
  248. if (url.indexOf( "?") != -1) {
  249. var str = url.substr( 1);
  250. strs = str.split( "&");
  251. for( var i = 0; i < strs.length; i ++) {
  252. theRequest[strs[i].split( "=")[ 0]] = unescape(strs[i].split( "=")[ 1]);
  253. }
  254. }
  255. return theRequest;
  256. },
  257. onConfirm(value, index) {
  258. console.log(value)
  259. this.form.KeepTime = value
  260. this.show1 = false
  261. },
  262. /*点击确定之后触发的点击事件*/
  263. onConfirm1(value, index) {
  264. console.log(value)
  265. this.form.WeekTime = value
  266. this.show2 = false
  267. },
  268. onChange(picker, value, index) {
  269. },
  270. /*定义显示弹出框的方法*/
  271. SetDateShow() {
  272. this.$refs.ScanTextBox1.readonly= 'readonly';
  273. setTimeout( () => {
  274. this.$refs.ScanTextBox1.readonly= null;
  275. }, 200);
  276. console.log( 11111)
  277. this.show1 = true
  278. },
  279. /*定于显示弹出框的方法*/
  280. SetDateShow1() {
  281. this.$refs.ScanTextBox2.readonly= 'readonly';
  282. setTimeout( () => {
  283. this.$refs.ScanTextBox2.readonly= null;
  284. }, 200);
  285. this.show2 = true
  286. },
  287. onCancel() {
  288. this.show = false
  289. this.show1 = false
  290. this.show2 = false
  291. },
  292. /*定于显示弹出框的方法*/
  293. SetTimeShow() {
  294. this.$refs.ScanTextBox.readonly= 'readonly';
  295. setTimeout( () => {
  296. this.$refs.ScanTextBox.readonly= null;
  297. }, 200);
  298. this.show = true
  299. },
  300. /* 执行日期的回调函数 处理日期的回调函数*/
  301. DataSelect(e) {
  302. var d = new Date(e);
  303. var datetime = d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate();
  304. /* console.log(e)
  305. console.log(e.getFullYear()) */
  306. let dateYear = e.getFullYear(); //获取年
  307. let dateMonth = e.getMonth() + 1 < 10 ? '0' + (e.getMonth() + 1) : e.getMonth() + 1; //获取月
  308. let dateDate = e.getDate() < 10 ? '0' + e.getDate() : new Date(e).getDate(); //获取当日
  309. this.form.SetTime = dateYear + "-" + dateMonth + "-" + dateDate
  310. this.bzDate = e;
  311. this.show = false
  312. },
  313. noNull(x) {
  314. if (x === "" || x === undefined || x === null) {
  315. return false;
  316. }
  317. return true;
  318. }
  319. /* timestampToDate(timestamp) {
  320. let data = new Date();
  321. data.setTime(timestamp * 1000)
  322. return data
  323. } */
  324. },
  325. });
  326. // 调用函数组件,弹出一个 Toast
  327. // 通过 CDN 引入时不会自动注册 Lazyload 组件
  328. // 可以通过下面的方式手动注册
  329. /* Vue.use(DatetimePicker);
  330. */
  331. /* let lastDate = document.getElementById("lastDate").value;
  332. let keepDate = $("#keepDate").val()
  333. let weekDate = $("#keepDate").val() */
  334. /* function upperCase(x) {
  335. var y = document.getElementById(x).value
  336. lastDate = y;
  337. }
  338. function upperKeepDate(x) {
  339. var y = document.getElementById(x).value
  340. keepDate = y;
  341. }
  342. function upperWeepDate(x) {
  343. var y = document.getElementById(x).value
  344. weekDate = y;
  345. }
  346. $("#thisOk").click(function() {
  347. console.log(1);
  348. console.log(lastDate);
  349. console.log(keepDate);
  350. console.log(weekDate);
  351. if (noNull(lastDate) && noNull(keepDate) && noNull(weekDate)) {
  352. window.location.href = "../index.html?lastDate=" + lastDate + "&keepDate=" + keepDate + "&weekDate=" + weekDate;
  353. } else {
  354. alert("请输入正确得值")
  355. }
  356. });
  357. function noNull(x) {
  358. if (x === "" || x === undefined || x === null) {
  359. return false;
  360. }
  361. return true;
  362. }*/
  363. </script>
  364. </html>

3.2.1(SBS后台管理预览)

3.3.1(电商管理系统预览)

3.4.1(农贸管理系统预览)

 

 

3.6.1更多系统页面预览.....

4总结

我是歌谣 css和h5开发页面没有什么捷径 我们需要一步一个脚印 不断积累 或许当你的代码达到十万行的时候 则你对于一个好的页面布局会有一个新的认知 我是歌谣 欢迎一起交流前后端知识 需要相关代码者可以评论留言

欢迎和大家一起学习前后端知识 一起成长


转载:https://blog.csdn.net/weixin_43392489/article/details/116848586
查看评论
* 以上用户言论只代表其个人观点,不代表本网站的观点或立场