博客列表 >仿京东app首页

仿京东app首页

Y的博客
Y的博客原创
2020年12月29日 00:01:22680浏览

效果图

主页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. <title>手机端页面</title>
  7. <link rel="stylesheet" href="../122301/static/css/index.css">
  8. <link rel="stylesheet" href="../122301/static/icon-font/iconfont.css">
  9. <link rel="stylesheet" href="../122301/static/css/header.css">
  10. <link rel="stylesheet" href="../122301/static/css/footer.css">
  11. <link rel="stylesheet" href="../122301/static/css/main.css">
  12. </head>
  13. <body>
  14. <!-- 页眉 -->
  15. <div class="header">
  16. <!-- 字体菜单 -->
  17. <div class="menu iconfont icon-menu"></div>
  18. <!-- 搜索框 -->
  19. <div class="search">
  20. <div class="logo">JD</div>
  21. <div class="zoom iconfont icon-search"></div>
  22. <input type="text" value="磁力片" class="words">
  23. </div>
  24. <!-- 登录按钮 -->
  25. <a href="" class="login">登录</a>
  26. </div>
  27. <!-- 主体 -->
  28. <div class="main">
  29. <!-- banner图 -->
  30. <div class="imag">
  31. <img src="../122301/static/images/bg/banner.jpg" alt="">
  32. </div>
  33. <!-- 主导航区 -->
  34. <ul class="nav">
  35. <li>
  36. <a href=""><img src="static/images/dh/nav-1.png" alt=""></a>
  37. <a href="">京东超市</a>
  38. </li>
  39. <li>
  40. <a href=""><img src="static/images/dh/nav-2.png" alt=""></a>
  41. <a href="">数码电器</a>
  42. </li>
  43. <li>
  44. <a href=""><img src="static/images/dh/nav-3.png" alt=""></a>
  45. <a href="">京东服饰</a>
  46. </li>
  47. <li>
  48. <a href=""><img src="static/images/dh/nav-4.png" alt=""></a>
  49. <a href="">京东生鲜</a>
  50. </li>
  51. <li>
  52. <a href=""><img src="static/images/dh/nav-5.png" alt=""></a>
  53. <a href="">京东到家</a>
  54. </li>
  55. <li>
  56. <a href=""><img src="static/images/dh/nav-6.png" alt=""></a>
  57. <a href="">充值缴费</a>
  58. </li>
  59. <li>
  60. <a href=""><img src="static/images/dh/nav-7.png" alt=""></a>
  61. <a href="">9.9元拼</a>
  62. </li>
  63. <li>
  64. <a href=""><img src="static/images/dh/nav-8.png" alt=""></a>
  65. <a href="">领券</a>
  66. </li>
  67. <li>
  68. <a href=""><img src="static/images/dh/nav-9.png" alt=""></a>
  69. <a href="">领金贴</a>
  70. </li>
  71. <li>
  72. <a href=""><img src="static/images/dh/nav-10.png" alt=""></a>
  73. <a href="">PLUS会员</a>
  74. </li>
  75. </ul>
  76. <!-- 秒杀区 -->
  77. <div class="ms">
  78. <!-- 头部 -->
  79. <div class="ms-top">
  80. <div class="left">
  81. <div class="title">京东秒杀</div>
  82. <div class="notice">
  83. <div class="tips">22点专场</div>
  84. <div class="time">01:11:22</div>
  85. </div>
  86. </div>
  87. <div class="right">更多秒杀</div>
  88. </div>
  89. <!-- 秒杀主体区 -->
  90. <ul class="ms-body">
  91. <li class="item">
  92. <a href=""><img src="static/images/ms/ms-1.jpg" alt=""></a>
  93. <div class="iconfont icon-rmb">338</div>
  94. <div class="iconfont icon-rmb">558</div>
  95. </li>
  96. <li class="item">
  97. <a href=""><img src="static/images/ms/ms-2.jpg" alt=""></a>
  98. <div class="iconfont icon-rmb">3456</div>
  99. <div class="iconfont icon-rmb">4567</div>
  100. </li>
  101. <li class="item">
  102. <a href=""><img src="static/images/ms/ms-3.jpg" alt=""></a>
  103. <div class="iconfont icon-rmb">789</div>
  104. <div class="iconfont icon-rmb">999</div>
  105. </li>
  106. <li class="item">
  107. <a href=""><img src="static/images/ms/ms-4.jpg" alt=""></a>
  108. <div class="iconfont icon-rmb">3213</div>
  109. <div class="iconfont icon-rmb">4532</div>
  110. </li>
  111. </ul>
  112. </div>
  113. </div>
  114. <!-- 页脚 -->
  115. <div class="footer">
  116. <div>
  117. <div class="iconfont icon-home"></div>
  118. <span>主页</span>
  119. </div>
  120. <div>
  121. <div class="iconfont icon-layers"></div>
  122. <span>分类</span>
  123. </div>
  124. <div>
  125. <div class="iconfont icon-kehuguanli"></div>
  126. <span>京喜</span>
  127. </div>
  128. <div>
  129. <div class="iconfont icon-shopping-cart"></div>
  130. <span>购物车</span>
  131. </div>
  132. <div>
  133. <div class="iconfont icon-user"></div>
  134. <span>未登录</span>
  135. </div>
  136. </div>
  137. </body>
  138. </html>

主页布局样式index.css

  1. /* 引入公共清除样式表 */
  2. @import'reset.css';
  3. /* 页眉 */
  4. .header {
  5. height: 4.4rem;
  6. background-color: #e43130;
  7. color: white;
  8. /* 固定定位 */
  9. position: fixed;
  10. top: 0;
  11. left: 0;
  12. right: 0;
  13. z-index: 100px;
  14. }
  15. /* 主体 */
  16. .main {
  17. position: absolute;
  18. top:4.4em;
  19. left: 0;
  20. right: 0;
  21. bottom:4.4em;
  22. font-size: 1.4rem;
  23. }
  24. /* 页脚 */
  25. .footer {
  26. height: 4.4rem;
  27. background-color: #fafafa
  28. color: #666;
  29. /* 固定定位 */
  30. position: fixed;
  31. bottom: 0;
  32. left: 0;
  33. right: 0;
  34. z-index: 100;
  35. }

清除样式表reset.css

  1. * {
  2. margin: 0;
  3. padding: 0;
  4. box-sizing: border-box;
  5. }
  6. li {
  7. list-style: none;
  8. }
  9. a {
  10. color: #7b7b7b;
  11. text-decoration: none;
  12. }

页眉样式header.css

  1. .header {
  2. display: flex;
  3. align-items: center;
  4. }
  5. .header .menu {
  6. flex: 1;
  7. font-size: 1.5rem;
  8. text-align: center;
  9. }
  10. .header .search {
  11. flex: 6;
  12. display: flex;
  13. background-color: #F7F7F7;
  14. padding: 0.5rem;
  15. border-radius: 3rem;
  16. display: flex;
  17. }
  18. /* logo */
  19. .header .search .logo {
  20. color: #E93B3D;
  21. flex: 0 1 3rem;
  22. font-size: 1.5rem;
  23. font-weight: bolder;
  24. /* 水平垂直居中 */
  25. text-align: center;
  26. line-height:2rem ;
  27. }
  28. /* 放大镜 */
  29. .header .search .zoom {
  30. color: #BBBBBB;
  31. flex: 0 1 3rem;
  32. border-left: 1px solid;
  33. /* 水平垂直居中 */
  34. text-align: center;
  35. line-height:2rem ;
  36. }
  37. .header .search .words {
  38. flex: auto;
  39. border: none;
  40. background-color: #F7F7F7;
  41. outline: none;
  42. color:#aaa ;
  43. }
  44. .header .login {
  45. flex: 1;
  46. color: white;
  47. text-align: center;
  48. }
  1. .footer {
  2. display: flex;
  3. justify-content: space-around;
  4. align-items: center;
  5. background-color: rgb(233, 231, 230);
  6. opacity: 0.8;
  7. }
  8. .footer>div{
  9. display: flex;
  10. flex-flow: column nowrap;
  11. align-items: center;
  12. }
  13. .footer>div>.iconfont{
  14. font-size: 1.9rem;
  15. color: rgb(66, 64, 64);
  16. }
  17. .footer>div>span{
  18. font-size: 0.9rem;
  19. color: rgb(66, 64, 64);
  20. }

主体区样式main.css

  1. .main .imag img {
  2. max-width: 96%;
  3. height: auto;
  4. border-radius: 0.5rem;
  5. position: relative;
  6. top: -1rem;
  7. left: 0.5rem;
  8. }
  9. .main .nav {
  10. display: flex;
  11. flex-flow: row wrap;
  12. justify-content: space-between;
  13. font-size: 1rem;
  14. }
  15. .main .nav img {
  16. width: 4rem;
  17. height: 4rem;
  18. }
  19. .main .nav li {
  20. flex: 1 1 20%;
  21. display: flex;
  22. flex-flow: column nowrap;
  23. align-items: center;
  24. }
  25. /* 秒杀 */
  26. .main .ms {
  27. background-color: #fff;
  28. padding: 1rem;
  29. margin: 1rem 0;
  30. }
  31. .main .ms .ms-top {
  32. font-size: 1.3rem;
  33. height: 3rem;
  34. display: flex;
  35. justify-content: space-between;
  36. }
  37. .main .ms .ms-top .left {
  38. display: flex;
  39. }
  40. .main .ms .ms-top .left .notice {
  41. font-size: 1.1rem;
  42. height: 2rem;
  43. border: 1px solid #e43130;
  44. border-radius: 2rem;
  45. margin-left: 1rem;
  46. display: flex;
  47. justify-content: center;
  48. align-items: center;
  49. }
  50. .main .ms .ms-top .left .notice .tips {
  51. background-color: #e43130;
  52. color: #fff;
  53. border-radius: 2rem;
  54. padding: 0.3rem 0.5rem;
  55. }
  56. .main .ms .ms-top .left .notice .time {
  57. padding: 0.3rem 0.5rem;
  58. }
  59. .main .ms .ms-top .right {
  60. color: #e43130;
  61. }
  62. /* 主体区 */
  63. .main .ms .ms-body {
  64. display: flex;
  65. justify-content: space-between;
  66. }
  67. .main .ms .ms-body img {
  68. height: 12rem;
  69. width: 12rem;
  70. }
  71. /* 秒杀价 */
  72. .main .ms .ms-body .item div:first-of-type {
  73. color: #e43130;
  74. font-weight: bolder;
  75. }
  76. /* 原价 */
  77. .main .ms .ms-body .item div:last-of-type {
  78. color: #666666;
  79. text-decoration: line-through;
  80. text-decoration-color: #666666;
  81. }
声明:本文内容转载自脚本之家,由网友自发贡献,版权归原作者所有,如您发现涉嫌抄袭侵权,请联系admin@php.cn 核实处理。
全部评论
文明上网理性发言,请遵守新闻评论服务协议