Blogger Information
Blog 29
fans 0
comment 0
visits 19794
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
仿京东首页
手机用户1576673622
Original
679 people have browsed it

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. <!-- 字体图标 -->
  9. <link rel="stylesheet" href="static/icon-font/iconfont.css">
  10. <!-- 首页 -->
  11. <link rel="stylesheet" href="static/csszy/index.css">
  12. <!-- 页眉 -->
  13. <link rel="stylesheet" href="static/csszy/header.css">
  14. <!-- 主导航区 -->
  15. <link rel="stylesheet" href="static/csszy/nav.css">
  16. <!-- 秒杀 -->
  17. <link rel="stylesheet" href="static/csszy/ms.css">
  18. <!-- 猜你喜欢 -->
  19. <link rel="stylesheet" href="static/csszy/tj.css">
  20. <!-- 页脚 -->
  21. <link rel="stylesheet" href="static/csszy/footer.css">
  22. </head>
  23. <body>
  24. <!-- 页眉 -->
  25. <div class="header">
  26. <!-- 菜单图标 -->
  27. <div class="menu iconfont icon-menu"></div>
  28. <!-- 搜素框 -->
  29. <div class="search">
  30. <div class="logo">JD</div>
  31. <div class="zoom iconfont icon-search"></div>
  32. <input class="words" type="text" value="鼠标键盘" >
  33. </div>
  34. <!-- 登录按钮 -->
  35. <a href="" class="login">登录</a>
  36. </div>
  37. <!-- 主体 -->
  38. <div class="main">
  39. <!-- 主导航区 -->
  40. <ul class="nav">
  41. <!-- 第一组 -->
  42. <li>
  43. <a href=""><img src="static/images/dh/nav-1.png" alt=""></a>
  44. <a href="">京东超市</a>
  45. </li>
  46. <li>
  47. <a href=""><img src="static/images/dh/nav-2.png" alt=""></a>
  48. <a href="">数码电器</a>
  49. </li>
  50. <li>
  51. <a href=""><img src="static/images/dh/nav-3.png" alt=""></a>
  52. <a href="">京东服饰</a>
  53. </li>
  54. <li>
  55. <a href=""><img src="static/images/dh/nav-4.png" alt=""></a>
  56. <a href="">京东生鲜</a>
  57. </li>
  58. <li>
  59. <a href=""><img src="static/images/dh/nav-5.png" alt=""></a>
  60. <a href="">京东到家</a>
  61. </li>
  62. <!-- 第二组 -->
  63. <li>
  64. <a href=""><img src="static/images/dh/nav-6.png" alt=""></a>
  65. <a href="">充值缴费</a>
  66. </li>
  67. <li>
  68. <a href=""><img src="static/images/dh/nav-7.png" alt=""></a>
  69. <a href="">9.9元拼</a>
  70. </li>
  71. <li>
  72. <a href=""><img src="static/images/dh/nav-8.png" alt=""></a>
  73. <a href="">领券</a>
  74. </li>
  75. <li>
  76. <a href=""><img src="static/images/dh/nav-9.png" alt=""></a>
  77. <a href="">领金贴</a>
  78. </li>
  79. <li>
  80. <a href=""><img src="static/images/dh/nav-10.png" alt=""></a>
  81. <a href="">PLUS会员</a>
  82. </li>
  83. </ul>
  84. <!-- 秒杀区 -->
  85. <div class="ms">
  86. <!-- 头部 -->
  87. <div class="ms-top">
  88. <div class="left">
  89. <div class="title">京东秒杀</div>
  90. <div class="notice">
  91. <div class="tips">16点专场</div>
  92. <div class="time">0:43:31</div>
  93. </div>
  94. </div>
  95. <div class="right">更多秒杀></div>
  96. </div>
  97. <!-- 秒杀区主体 -->
  98. <ul class="ms-body">
  99. <li>
  100. <a href=""><img src="static/images/ms/ms-1.jpg" alt=""></a>
  101. <div class="iconfont icon-rmb">455</div>
  102. <div class="iconfont icon-rmb">555</div>
  103. </li>
  104. <li>
  105. <a href=""><img src="static/images/ms/ms-2.jpg" alt=""></a>
  106. <div class="iconfont icon-rmb">236</div>
  107. <div class="iconfont icon-rmb">322</div>
  108. </li>
  109. <li>
  110. <a href=""><img src="static/images/ms/ms-3.jpg" alt=""></a>
  111. <div class="iconfont icon-rmb">344</div>
  112. <div class="iconfont icon-rmb">555</div>
  113. </li>
  114. <li>
  115. <a href=""><img src="static/images/ms/ms-4.jpg" alt=""></a>
  116. <div class="iconfont icon-rmb">234</div>
  117. <div class="iconfont icon-rmb">642</div>
  118. </li>
  119. </ul>
  120. </div>
  121. <!-- 推荐区 -->
  122. <h2 class="title">猜你喜欢</h2>
  123. <ul class="tj">
  124. <li class="item">
  125. <a href=""><img src="static/images/sp/sp-1.webp" alt=""></a>
  126. <p>商品介绍商品介绍商品介绍商品介绍商品介绍商品介绍商品介绍商品介品介绍商品介绍</p>
  127. <div class="price">
  128. <div class="iconfont icon-rmb">203</div>
  129. <div>看相似</div>
  130. </div>
  131. </li>
  132. <li class="item">
  133. <a href=""><img src="static/images/sp/sp-2.webp" alt=""></a>
  134. <p>商品介绍商品介绍商品介绍商品介绍商品介绍商品介绍商品介绍商品介品介绍商品介绍</p>
  135. <div class="price">
  136. <div class="iconfont icon-rmb">203</div>
  137. <div>看相似</div>
  138. </div>
  139. </li>
  140. <li class="item">
  141. <a href=""><img src="static/images/sp/sp-3.webp" alt=""></a>
  142. <p>商品介绍商品介绍商品介绍商品介绍商品介绍商品介绍商品介绍商品介品介绍商品介绍</p>
  143. <div class="price">
  144. <div class="iconfont icon-rmb">203</div>
  145. <div>看相似</div>
  146. </div>
  147. </li>
  148. <li class="item">
  149. <a href=""><img src="static/images/sp/sp-4.webp" alt=""></a>
  150. <p>商品介绍商品介绍商品介绍商品介绍商品介绍商品介绍商品介绍商品介品介绍商品介绍</p>
  151. <div class="price">
  152. <div class="iconfont icon-rmb">203</div>
  153. <div>看相似</div>
  154. </div>
  155. </li>
  156. <li class="item">
  157. <a href=""><img src="static/images/sp/sp-5.webp" alt=""></a>
  158. <p>商品介绍商品介绍商品介绍商品介绍商品介绍商品介绍商品介绍商品介品介绍商品介绍</p>
  159. <div class="price">
  160. <div class="iconfont icon-rmb">203</div>
  161. <div>看相似</div>
  162. </div>
  163. </li>
  164. <li class="item">
  165. <a href=""><img src="static/images/sp/sp-6.webp" alt=""></a>
  166. <p>商品介绍商品介绍商品介绍商品介绍商品介绍商品介绍商品介绍商品介品介绍商品介绍</p>
  167. <div class="price">
  168. <div class="iconfont icon-rmb">203</div>
  169. <div>看相似</div>
  170. </div>
  171. </li>
  172. </ul>
  173. </div>
  174. <!-- 页脚 -->
  175. <div class="footer">
  176. <div>
  177. <div class="iconfont icon-home"></div>
  178. <span>主页</span>
  179. </div>
  180. <div>
  181. <div class="iconfont icon-layers"></div>
  182. <span>分类</span>
  183. </div>
  184. <div>
  185. <div class="iconfont icon-kehuguanli"></div>
  186. <span>京喜</span>
  187. </div>
  188. <div>
  189. <div class="iconfont icon-shopping-cart"></div>
  190. <span>购物车</span>
  191. </div>
  192. <div>
  193. <div class="iconfont icon-user"></div>
  194. <span>未登录</span>
  195. </div>
  196. </div>
  197. </body>
  198. </html>

reset

  1. /* 调整 初始化 */
  2. * {
  3. margin: 0;
  4. padding: 0;
  5. box-sizing: border-box;
  6. }
  7. li {
  8. /* 去除列表前的小黑点 */
  9. list-style: none;
  10. }
  11. a {
  12. /* 去除线条 */
  13. color: #7b7b7b;
  14. text-decoration: none;
  15. }
  16. body {
  17. background-color: #f6f6f6;
  18. }
  19. html {
  20. font-size: 10px;
  21. }
  22. /* 媒体查询 */
  23. @media screen and (min-width: 480px) {
  24. html {
  25. font-size: 12px;
  26. }
  27. }
  28. @media screen and (min-width: 640px) {
  29. html {
  30. font-size: 14px;
  31. }
  32. }
  33. @media screen and (min-width: 720px) {
  34. html {
  35. font-size: 16px;
  36. }
  37. }

index

  1. /* 索引 目录 */
  2. @import 'reset.css';
  3. /* 页眉 */
  4. .header {
  5. background-color: #e43130;
  6. color: #fff;
  7. height:4.4rem;
  8. /* 固定定位 */
  9. position: fixed;
  10. top: 0;
  11. right: 0;
  12. left: 0;
  13. z-index: 100;
  14. font-size: 1.4rem;
  15. }
  16. /* 页脚 */
  17. .footer {
  18. background-color: #fafafa;
  19. color: #666;
  20. box-shadow: 0 0 3px #999;
  21. height:4.4rem;
  22. /* 固定定位 */
  23. position: fixed;
  24. bottom: 0;
  25. right: 0;
  26. left: 0;
  27. z-index: 100;
  28. }
  29. /* 主体 */
  30. .main {
  31. /* 绝对定位 */
  32. position: absolute;
  33. bottom: 4.4rem;
  34. top: 4.4rem;
  35. right: 0;
  36. left: 0;
  37. font-size: 1.4rem;
  38. }

header

  1. /* 页眉样式 */
  2. .header {
  3. display: flex;
  4. align-items: center
  5. }
  6. /* 页眉比列 1;6;1 */
  7. /* 登录按钮 */
  8. .header .login {
  9. color: #fff;
  10. text-align: center;
  11. flex: 1;
  12. }
  13. /* 菜单图标 */
  14. .header .menu {
  15. text-align: center;
  16. flex: 1;
  17. font-size: 2.5rem;
  18. }
  19. /* 搜索框 */
  20. .header .search {
  21. flex: 6;
  22. padding: 0.5rem;
  23. background-color: #fff;
  24. border-radius: 3rem;
  25. display: flex;
  26. }
  27. /* jd图标 */
  28. .header .search .logo {
  29. color: #e43130;
  30. flex: 0 1 3rem;
  31. font-size: 2rem;
  32. /* 水平垂直居中 */
  33. text-align: center;
  34. line-height: 2rem;
  35. }
  36. /* 放大镜 */
  37. .header .search .zoom {
  38. color: #ccc;
  39. flex: 0 1 4rem;
  40. border-left: 1px solid;
  41. /* 水平垂直居中 */
  42. text-align: center;
  43. line-height: 2rem
  44. }
  45. /* 搜索框 */
  46. .header .search .words {
  47. flex: auto;
  48. border: none;
  49. outline: none;
  50. color: #aaa;
  51. }

nav

  1. /* 主导航区 */
  2. .main .nav {
  3. display: flex;
  4. flex-flow: row wrap;
  5. justify-content: space-around;
  6. }
  7. .main .nav img {
  8. width: 4rem;
  9. height: 4rem;
  10. }
  11. .main .nav li {
  12. /* 每一块占据20% */
  13. flex: 1 1 20%;
  14. display: flex;
  15. flex-flow: column wrap;
  16. align-items: center;
  17. }

秒杀

  1. /* 秒杀css */
  2. .main .ms {
  3. background-color: #fff;
  4. padding: 1rem;
  5. margin: 1rem 0;
  6. }
  7. .main .ms .ms-top {
  8. font-size: 1.3rem;
  9. height: 3rem;
  10. display: flex;
  11. justify-content: space-between;
  12. }
  13. .main .ms .ms-top .left {
  14. display: flex;
  15. }
  16. .main .ms .ms-top .left .notice {
  17. font-size: 1.1rem;
  18. height: 2rem;
  19. border: 1px solid #e43130;
  20. border-radius: 2rem;
  21. margin-left: 1rem;
  22. display: flex;
  23. justify-content: center;
  24. align-items: center;
  25. }
  26. .main .ms .ms-top .left .notice .tips {
  27. background-color: #e43130;
  28. color: #fff;
  29. border-radius: 2rem;
  30. padding: 0.3rem 0.5rem;
  31. }
  32. .main .ms .ms-top .left .notice .time {
  33. padding: 0.3rem 0.5rem;
  34. }
  35. .main .ms .ms-top .right {
  36. color: #e43130;
  37. }
  38. /* 主体区 */
  39. .main .ms .ms-body {
  40. display: flex;
  41. justify-content: space-between
  42. }
  43. .main .ms .ms-body img {
  44. height: 12rem;
  45. width: 12rem;
  46. }
  47. /* 秒杀价 */
  48. .main .ms .ms-body li div:first-of-type {
  49. color: #e43130;
  50. font-weight: bolder;
  51. }
  52. /* 原价 */
  53. .main .ms .ms-body li div:last-of-type {
  54. color: #666666;
  55. text-decoration: line-through;
  56. text-decoration-color: #666666;
  57. }

推荐

  1. .main .title {
  2. height: 4rem;
  3. color: #555;
  4. text-align: center;
  5. }
  6. .main .tj {
  7. font-size: 1rem;
  8. display: flex;
  9. /* 换行 */
  10. flex-wrap: wrap;
  11. }
  12. .main .tj .item {
  13. flex: 1 1 calc(50% - 2rem);
  14. background-color: #fff;
  15. overflow: hidden;
  16. display: flex;
  17. flex-flow: column nowrap;
  18. margin-left: 1rem;
  19. margin-bottom: 1rem;
  20. padding-bottom: 1rem;
  21. border-radius: 1rem;
  22. }
  23. .main .tj .item img {
  24. width: 100%;
  25. height: 100%;
  26. }
  27. .main .tj .item {
  28. padding: 1rem;
  29. }
  30. .main .tj .item .price {
  31. display: flex;
  32. justify-content: space-between;
  33. }
  34. .main .tj .item .price div:first-of-type {
  35. color: red;
  36. }
  37. .main .tj .item .price div:last-of-type {
  38. color: #666;
  39. background-color: #f6f6f6;
  40. border-radius: 1rem;
  41. padding: 0.2rem 1rem;
  42. }
  1. .footer {
  2. display: flex;
  3. justify-content: space-around;
  4. align-items: center;
  5. }
  6. footer > div {
  7. display: flex;
  8. flex-flow: column nowrap;
  9. align-items: center;
  10. }
  11. .footer > div > .iconfont {
  12. font-size: 2rem;
  13. }
  14. .footer > div > span {
  15. font-size: 1rem;
  16. }
Correcting teacher:天蓬老师天蓬老师

Correction status:qualified

Teacher's comments:效果图呢?
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post