博客列表 >京东APP首页

京东APP首页

庄周梦蝶
庄周梦蝶原创
2021年01月02日 20:25:50698浏览

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. <title>Document</title>
  7. <link rel="stylesheet" href="static/css/index.css" />
  8. <link rel="stylesheet" href="static/icon-font/iconfont.css" />
  9. </head>
  10. <body>
  11. <div class="header">
  12. <div class="menu iconfont icon-menu"></div>
  13. <div class="search">
  14. <div class="logo">JD</div>
  15. <div class="zoom iconfont icon-search"></div>
  16. <input class="words" type="text" value="钢琴" />
  17. </div>
  18. <a href="" class="login">登录</a>
  19. </div>
  20. <div class="main">
  21. <ul class="nav">
  22. <li>
  23. <a href=""
  24. ><img src="static/images/dh/nav-1.png" alt="" /> 京东超市</a
  25. >
  26. </li>
  27. <li>
  28. <a href=""
  29. ><img src="static/images/dh/nav-2.png" alt="" /> 数码电器</a
  30. >
  31. </li>
  32. <li>
  33. <a href=""><img src="static/images/dh/nav-3.png" alt="" />京东服饰</a>
  34. </li>
  35. <li>
  36. <a href=""><img src="static/images/dh/nav-4.png" alt="" />京东生鲜</a>
  37. </li>
  38. <li>
  39. <a href=""><img src="static/images/dh/nav-5.png" alt="" />京东到家</a>
  40. </li>
  41. <li>
  42. <a href=""><img src="static/images/dh/nav-6.png" alt="" />充值缴费</a>
  43. </li>
  44. <li>
  45. <a href=""><img src="static/images/dh/nav-7.png" alt="" />9.9元拼</a>
  46. </li>
  47. <li>
  48. <a href=""><img src="static/images/dh/nav-8.png" alt="" />领券</a>
  49. </li>
  50. <li>
  51. <a href=""><img src="static/images/dh/nav-9.png" alt="" />领金贴</a>
  52. </li>
  53. <li>
  54. <a href=""
  55. ><img src="static/images/dh/nav-10.png" alt="" />PLUS会员</a
  56. >
  57. </li>
  58. </ul>
  59. <!-- 秒杀 -->
  60. <div class="ms">
  61. <div class="ms-top">
  62. <div class="ms-left">
  63. <div class="mst">京东秒杀</div>
  64. <div class="ms-left-top">
  65. <div class="dc">18点场</div>
  66. <div class="ms-time">00:52:00</div>
  67. </div>
  68. </div>
  69. <div class="ms-right">更多秒杀<samp>&#62;</samp></div>
  70. </div>
  71. <div class="ms-main">
  72. <ul>
  73. <li>
  74. <a href=""><img src="static/images/ms/ms-1.jpg" alt="" /></a>
  75. <span><em class="iconfont icon-rmb"></em>1359</span>
  76. <span><em class="iconfont icon-rmb"></em>1359</span>
  77. </li>
  78. <li>
  79. <a href=""><img src="static/images/ms/ms-2.jpg" alt="" /></a>
  80. <span><em class="iconfont icon-rmb"></em>1359</span>
  81. <span><em class="iconfont icon-rmb"></em>1359</span>
  82. </li>
  83. <li>
  84. <a href=""><img src="static/images/ms/ms-3.jpg" alt="" /></a>
  85. <span><em class="iconfont icon-rmb"></em>1359</span>
  86. <span><em class="iconfont icon-rmb"></em>1359</span>
  87. </li>
  88. <li>
  89. <a href=""><img src="static/images/ms/ms-4.jpg" alt="" /></a>
  90. <span><em class="iconfont icon-rmb"></em>1359</span>
  91. <span><em class="iconfont icon-rmb"></em>1359</span>
  92. </li>
  93. <li>
  94. <a href=""><img src="static/images/ms/ms-5.jpg" alt="" /></a>
  95. <span><em class="iconfont icon-rmb"></em>1359</span>
  96. <span><em class="iconfont icon-rmb"></em>1359</span>
  97. </li>
  98. <li>
  99. <a href=""><img src="static/images/ms/ms-6.jpg" alt="" /></a>
  100. <span><em class="iconfont icon-rmb"></em>1359</span>
  101. <span><em class="iconfont icon-rmb"></em>1359</span>
  102. </li>
  103. </ul>
  104. </div>
  105. </div>
  106. <!-- 商品区 -->
  107. <div class="main-cenn">
  108. <ul>
  109. <li>
  110. <a href="">
  111. <img src="static/images/sp/sp-1.webp" alt="" />
  112. <span class="hh"
  113. >商品姓名商品姓名商品姓名商品姓名商品姓名商品姓名商品姓名商品姓名</span
  114. >
  115. <div>
  116. <p><em class="iconfont icon-rmb"></em>1679</p>
  117. <p>看相识</p>
  118. </div>
  119. </a>
  120. </li>
  121. <li>
  122. <a href="">
  123. <img src="static/images/sp/sp-2.webp" alt="" />
  124. <span
  125. >商品姓名商品姓名商品姓名商品姓名商品姓名商品姓名商品姓名商品姓名</span
  126. >
  127. <div>
  128. <p><em class="iconfont icon-rmb"></em>1679</p>
  129. <p>看相识</p>
  130. </div>
  131. </a>
  132. </li>
  133. <li>
  134. <a href="">
  135. <img src="static/images/sp/sp-3.webp" alt="" />
  136. <span
  137. >商品姓名商品姓名商品姓名商品姓名商品姓名商品姓名商品姓名商品姓名</span
  138. >
  139. <div>
  140. <p><em class="iconfont icon-rmb"></em>1679</p>
  141. <p>看相识</p>
  142. </div>
  143. </a>
  144. </li>
  145. <li>
  146. <a href="">
  147. <img src="static/images/sp/sp-4.webp" alt="" />
  148. <span
  149. >商品姓名商品姓名商品姓名商品姓名商品姓名商品姓名商品姓名商品姓名</span
  150. >
  151. <div>
  152. <p><em class="iconfont icon-rmb"></em>1679</p>
  153. <p>看相识</p>
  154. </div>
  155. </a>
  156. </li>
  157. <li>
  158. <a href="">
  159. <img src="static/images/sp/sp-5.webp" alt="" />
  160. <span
  161. >商品姓名商品姓名商品姓名商品姓名商品姓名商品姓名商品姓名商品姓名</span
  162. >
  163. <div>
  164. <p><em class="iconfont icon-rmb"></em>1679</p>
  165. <p>看相识</p>
  166. </div>
  167. </a>
  168. </li>
  169. <li>
  170. <a href="">
  171. <img src="static/images/sp/sp-6.webp" alt="" />
  172. <span
  173. >商品姓名商品姓名商品姓名商品姓名商品姓名商品姓名商品姓名商品姓名</span
  174. >
  175. <div>
  176. <p><em class="iconfont icon-rmb"></em>1679</p>
  177. <p>看相识</p>
  178. </div>
  179. </a>
  180. </li>
  181. <li>
  182. <a href="">
  183. <img src="static/images/sp/sp-7.webp" alt="" />
  184. <span
  185. >商品姓名商品姓名商品姓名商品姓名商品姓名商品姓名商品姓名商品姓名</span
  186. >
  187. <div>
  188. <p><em class="iconfont icon-rmb"></em>1679</p>
  189. <p>看相识</p>
  190. </div>
  191. </a>
  192. </li>
  193. <li>
  194. <a href="">
  195. <img src="static/images/sp/sp-8.webp" alt="" />
  196. <span
  197. >商品姓名商品姓名商品姓名商品姓名商品姓名商品姓名商品姓名商品姓名</span
  198. >
  199. <div>
  200. <p><em class="iconfont icon-rmb"></em>1679</p>
  201. <p>看相识</p>
  202. </div>
  203. </a>
  204. </li>
  205. </ul>
  206. </div>
  207. </div>
  208. <div class="footcr">
  209. <a href="">
  210. <div class="coot iconfont icon-home"></div>
  211. <span>首页</span>
  212. </a>
  213. <a href="">
  214. <div class="coot iconfont icon-layers"></div>
  215. <span>分类</span>
  216. </a>
  217. <a href="">
  218. <div class="coot iconfont icon-settings"></div>
  219. <span>惊喜</span>
  220. </a>
  221. <a href="">
  222. <div class="coot iconfont icon-shopping-cart"></div>
  223. <span>购物车</span>
  224. </a>
  225. <a href="">
  226. <div class="coot iconfont icon-user"></div>
  227. <span>未登录</span>
  228. </a>
  229. </div>
  230. </body>
  231. </html>

css部分

  1. @import "reset.css";
  2. .header {
  3. background-color: #e43130;
  4. color: white;
  5. height: 4.4rem;
  6. position: fixed;
  7. top: 0;
  8. left: 0;
  9. right: 0;
  10. z-index: 100;
  11. font-size: 1.4rem;
  12. }
  13. .footcr {
  14. background-color: #fafafa;
  15. color: #666;
  16. box-shadow: 0 0 3px #999999;
  17. height: 4.4rem;
  18. position: fixed;
  19. bottom: 0;
  20. left: 0;
  21. right: 0;
  22. z-index: 100;
  23. font-size: 1.4rem;
  24. }
  25. /* 主体 */
  26. .main {
  27. position: absolute;
  28. top: 4.4rem;
  29. bottom: 4.4rem;
  30. left: 0;
  31. right: 0;
  32. font-size: 1.4rem;
  33. }
  34. /* 头部 */
  35. .header {
  36. display: flex;
  37. align-items: center;
  38. }
  39. .header .login {
  40. color: #fff;
  41. text-align: center;
  42. flex: 1;
  43. }
  44. .header .menu {
  45. text-align: center;
  46. flex: 1;
  47. font-size: 2.5rem;
  48. }
  49. .header .search {
  50. flex: 6;
  51. padding: 0.5rem;
  52. background-color: #fff;
  53. border-radius: 3rem;
  54. display: flex;
  55. }
  56. .header .search .logo {
  57. color: #e43130;
  58. flex: 0 1 4rem;
  59. font-size: 2rem;
  60. text-align: center;
  61. line-height: 2rem;
  62. }
  63. .header .search .zoom {
  64. color: #cccccc;
  65. flex: 0 1 4rem;
  66. border-left: 1px solid;
  67. border-radius: 0;
  68. text-align: center;
  69. line-height: 2rem;
  70. }
  71. .header .search .words {
  72. /* 占据剩余的所有 */
  73. flex: auto;
  74. border: none;
  75. outline: none;
  76. }
  77. /* 内容 */
  78. .main .nav {
  79. display: flex;
  80. padding: 1rem;
  81. flex-flow: row wrap;
  82. justify-content: space-between;
  83. background-color: #fff;
  84. margin: 1rem;
  85. border-radius: 0.8rem;
  86. }
  87. .main .nav img {
  88. height: 4rem;
  89. width: 4rem;
  90. }
  91. .main .nav li {
  92. flex: 1 1 20%;
  93. display: flex;
  94. flex-flow: column nowrap;
  95. padding: 0.5rem 0;
  96. }
  97. .main .nav li a {
  98. display: flex;
  99. flex-flow: column nowrap;
  100. align-items: center;
  101. }
  102. /* 秒杀 */
  103. .main .ms {
  104. margin: 1rem;
  105. padding: 0.5rem 1rem;
  106. background-color: #fff;
  107. border-radius: 0.8rem;
  108. }
  109. .main .ms .ms-top {
  110. font-size: 1.3rem;
  111. width: 100%;
  112. height: 2.5rem;
  113. display: flex;
  114. /* 剩余空间都分配到中间 */
  115. justify-content: space-between;
  116. background: url(../images/bg/index.png) no-repeat;
  117. background-size: 100% 100%;
  118. }
  119. .main .ms .ms-top .ms-left {
  120. display: flex;
  121. }
  122. .main .ms .ms-top .ms-left .mst {
  123. font-size: 1.5rem;
  124. }
  125. .main .ms .ms-top .ms-left .ms-left-top {
  126. font-size: 1.1rem;
  127. height: 2rem;
  128. border-radius: 2rem;
  129. border: 1px solid #e43130;
  130. margin-left: 1rem;
  131. justify-content: center;
  132. align-items: center;
  133. display: flex;
  134. }
  135. .main .ms .ms-top .ms-left .ms-left-top .dc {
  136. background-color: #e43130;
  137. border-radius: 2rem;
  138. color: #fff;
  139. padding: 0.2rem 0.5rem;
  140. }
  141. .main .ms .ms-top .ms-left .ms-left-top .ms-time {
  142. padding: 0.2rem 1rem;
  143. }
  144. .ms .ms-top .ms-right {
  145. font-size: 1.5rem;
  146. color: #e43130;
  147. }
  148. /* 秒杀内容 */
  149. .ms-main ul {
  150. display: flex;
  151. overflow-y: auto;
  152. padding-bottom: 10px;
  153. }
  154. .ms-main ul li {
  155. display: flex;
  156. flex-flow: column nowrap;
  157. align-content: center;
  158. text-align: center;
  159. margin: 0.7rem;
  160. }
  161. .ms-main ul li img {
  162. width: 9rem;
  163. }
  164. .ms-main ul li span:first-of-type {
  165. color: #e43130;
  166. font-weight: bolder;
  167. }
  168. .ms-main ul li span:last-of-type {
  169. color: #666666;
  170. text-decoration: line-through;
  171. font-size: 1.3rem;
  172. }
  173. /* 商品 */
  174. .main-cenn ul {
  175. display: flex;
  176. flex-flow: row wrap;
  177. margin-right: 1rem;
  178. }
  179. .main-cenn ul li {
  180. flex: 1 1 50%;
  181. padding-left: 1rem;
  182. padding-bottom: 1rem;
  183. }
  184. .main-cenn ul li a {
  185. display: flex;
  186. flex-flow: column nowrap;
  187. background-color: #fff;
  188. padding: 0.5rem;
  189. border-radius: 0.5rem;
  190. }
  191. .main-cenn ul li a span {
  192. display: -webkit-box;
  193. -webkit-line-clamp: 2;
  194. -webkit-box-orient: vertical;
  195. text-overflow: ellipsis;
  196. overflow: hidden;
  197. }
  198. .main-cenn ul li a img {
  199. width: 100%;
  200. border-radius: 0.5rem;
  201. }
  202. .main-cenn ul li a div {
  203. display: flex;
  204. justify-content: space-between;
  205. }
  206. .main-cenn ul li a div p:first-of-type {
  207. color: #e43130;
  208. font-weight: bolder;
  209. }
  210. .main-cenn ul li a div p:last-of-type {
  211. color: #666666;
  212. font-size: 1rem;
  213. padding: 0 0.2rem;
  214. border: #666666 1px solid;
  215. border-radius: 1rem;
  216. }
  217. /* 底部 */
  218. .footcr {
  219. display: flex;
  220. justify-content: space-around;
  221. align-items: center;
  222. }
  223. .footcr > a > div {
  224. display: flex;
  225. flex-flow: column nowrap;
  226. align-items: center;
  227. font-size: 2rem;
  228. }
  229. .footcr > a > span {
  230. font-size: 1rem;
  231. }

效果

声明:本文内容转载自脚本之家,由网友自发贡献,版权归原作者所有,如您发现涉嫌抄袭侵权,请联系admin@php.cn 核实处理。
全部评论
文明上网理性发言,请遵守新闻评论服务协议