博客列表 >flex布局仿站练习

flex布局仿站练习

leverWang
leverWang原创
2020年07月02日 17:26:30682浏览

flex布局练习

css

  1. @charset "UTF-8";
  2. @font-face { font-family: 'iconfont'; /* project id 1913940 */ src: url("//at.alicdn.com/t/font_1913940_smuvpc4954.eot"); src: url("//at.alicdn.com/t/font_1913940_smuvpc4954.eot?#iefix") format("embedded-opentype"), url("//at.alicdn.com/t/font_1913940_smuvpc4954.woff2") format("woff2"), url("//at.alicdn.com/t/font_1913940_smuvpc4954.woff") format("woff"), url("//at.alicdn.com/t/font_1913940_smuvpc4954.ttf") format("truetype"), url("//at.alicdn.com/t/font_1913940_smuvpc4954.svg#iconfont") format("svg"); }
  3. .icon { font-family: "iconfont" !important; font-size: 14px; font-style: normal; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
  4. * { padding: 0; margin: 0; box-sizing: border-box; outline: 0; cursor: pointer; }
  5. img { width: 100%; height: auto; }
  6. li { list-style: none; }
  7. a { text-decoration: none; color: #666; }
  8. body { width: 100vw; height: 300vh; overflow-x: hidden !important; background-color: #f6f6f6; }
  9. header { width: 100%; height: 13em; }
  10. .search_wrapper { position: fixed; display: flex; width: 100%; min-height: 44px; color: #fff; justify-content: space-between; background-color: #c82519; margin-bottom: 5px; z-index: 100; }
  11. .search_wrapper > .item { flex: 0 0 50px; display: flex; flex-direction: column; justify-content: center; }
  12. /* 搜索框样式 */
  13. .search_wrapper > .item:nth-of-type(2) { flex: 1; display: flex; flex-direction: column; justify-content: center; }
  14. .search_wrapper > .item > .searchbar { background: #fff; border-radius: 20px; height: 30px; margin-right: 10px; }
  15. .search_wrapper > .item > .searchbar .s-left { float: left; }
  16. .search_wrapper > .item > .icon { color: #fff; font-size: 1.7em; text-align: center; }
  17. .search_wrapper .searchbar .s-input-logo { color: #f1503b; margin: 8px 8px 0 15px; font-weight: bold; position: relative; }
  18. .search_wrapper .searchbar .s-input-logo::after { content: ""; position: absolute; border-right: 1px solid #ddd; top: 0; left: 26px; height: 16px; }
  19. .search_wrapper .searchbar .s-input-icon { position: relative; margin: 5px 0 0 8px; color: #999; font-size: 1.2em; }
  20. .search_wrapper .searchbar input { border: none; margin: 9px 0 0 10px; font-size: 12px; width: 70%; }
  21. .search_wrapper .login { font-size: 1em; }
  22. .slider-bg { background-image: linear-gradient(0deg, #f1503b, #c82519 50%); position: absolute; top: 0; left: -25%; height: 10em; width: 150%; border-bottom-left-radius: 100%; border-bottom-right-radius: 100%; z-index: -1; }
  23. /* 焦点图 */
  24. .focus { width: 93vw; margin: auto; position: relative; top: 3em; }
  25. .focus .hd { width: 100%; position: absolute; z-index: 1; bottom: 1em; display: flex; justify-content: center; }
  26. .focus .hd li { background: rgba(255, 255, 255, 0.5); width: 8px; height: 3px; margin: 0 2px; overflow: hidden; }
  27. .focus .hd li.on { background: white; width: 12px; }
  28. .focus .bd li img { width: 100%; border-radius: .35em; }
  29. /* 栏目导航 */
  30. .navigation { position: relative; padding: .5em 0 0.3em 0; }
  31. .navigation > .nav-hd { width: 100%; position: absolute; z-index: 1; bottom: .8em; display: flex; justify-content: center; }
  32. .navigation > .nav-hd li { width: 5px; height: 5px; background-color: rgba(0, 0, 0, 0.3); border-radius: 50%; margin: 0 3px; }
  33. .navigation > .nav-hd li.on { background-color: #e93b3d; width: 10px; height: 5px; border-radius: 3px; opacity: .7; }
  34. .nav { display: flex; flex-flow: row wrap; margin-bottom: 15px; justify-content: space-around; }
  35. .nav a { text-align: center; flex: 0 0 auto; min-width: 20%; font-size: .6em; text-align: center; margin-bottom: 10px; }
  36. .nav a span { display: block; }
  37. .nav img { margin-bottom: 5px; width: 44px; }
  38. /* 秒杀 */
  39. .seckill { width: 93vw; margin: auto; background: #fff; border-radius: .4em; padding: .6em 0 .8em 0; font-size: 14px; overflow: hidden; }
  40. .seckill > .title_wrap { display: flex; justify-content: flex-start; }
  41. .seckill > .title_wrap > .sec-tit { margin: 0 .4em 0 .6em; }
  42. .seckill > .title_wrap > .sec-time-wrap { border: 1px solid #f2270c; border-radius: .4rem; }
  43. .seckill > .title_wrap > .sec-time-wrap > .sec-time-order { float: left; border-radius: .4rem; background: #f2270c; color: #fff; padding: 0 0.3em; margin-right: .5em; }
  44. .seckill > .title_wrap > .sec-time-wrap > .sec-timer { float: right; padding-right: .5em; color: #f2270c; font-weight: bold; }
  45. .seckill > .title_wrap > .sec-more { margin-left: auto; margin-right: .5em; color: #f2270c; }
  46. .seckill > .title_wrap > .sec-more > i { margin-left: .3em; }
  47. /* 秒杀列表 */
  48. .seckill-wrap { overflow-x: scroll; }
  49. .seckill-wrap > .sec-list { display: flex; flex-flow: row nowrap; justify-content: flex-start; overflow: hidden; margin: .8em 0 0 .6em; }
  50. .seckill-wrap > .sec-list > .sec-item { flex: 0 0 auto; width: 75px; text-align: center; margin-right: .6em; }
  51. .seckill-wrap > .sec-list > .sec-item img { width: 100%; }
  52. .seckill-wrap > .sec-list > .sec-item span { display: block; font-weight: 550; margin-top: .5em; }
  53. .seckill-wrap > .sec-list > .sec-item span:first-of-type { color: #f2270c; }
  54. .seckill-wrap > .sec-list > .sec-item span:last-of-type { color: #999; text-decoration: line-through; }
  55. /* banner */
  56. .banner { width: 93vw; margin: auto; position: relative; margin-top: .8em; }
  57. .banner > .show-banner { height: 7.8em; display: flex; justify-content: center; overflow: hidden; border-radius: 0.6em; }
  58. .banner-full { margin-top: .8em; }
  59. /* 小院 */
  60. .module-jdxy { width: 93vw; margin: auto; position: relative; border-radius: .4em; background: #fff; margin-bottom: .6em; }
  61. .module-jdxy > .m-two { display: flex; justify-content: space-around; }
  62. .module-jdxy > .m-two > .item { flex: 1; position: relative; padding: .5em .6em; }
  63. .module-jdxy > .m-two > .item::after { height: 100%; content: ""; width: 1px; border-right: 1px solid #ddd; position: absolute; top: 0; right: 0; transform: scaleX(0.5); z-index: 10; }
  64. .module-jdxy > .m-two > .item > .item-tit { font-size: 1.1em; font-weight: bold; background: linear-gradient(50deg, #45CAFF, #1471FB); background-clip: content-box; color: transparent; -webkit-background-clip: text; }
  65. .module-jdxy > .m-two > .item > .item-txt { font-size: .8em; color: #7e7e7e; margin-bottom: .5em; }
  66. .module-jdxy > .m-two > .item > .item-img { display: flex; justify-content: space-around; }
  67. .module-jdxy > .m-two > .item > .item-img a { flex: 0 0 auto; width: 4.2em; height: 4.2em; }
  68. .module-jdxy > .m-4 { display: flex; justify-content: center; border-top: 1px solid #f0f0f0; }
  69. .module-jdxy > .m-4 > .item { flex: 1; position: relative; padding: .3em 0 .3em .6em; }
  70. .module-jdxy > .m-4 > .item > .item-tit { font-size: 1.1em; font-weight: bold; }
  71. .module-jdxy > .m-4 > .item > .item-txt { font-size: .8em; color: #7e7e7e; display: block; }
  72. .module-jdxy > .m-4 > .item img { width: 83%; margin-top: .5em; }
  73. /* 每日逛 */
  74. .module-br { width: 93vw; margin: auto; position: relative; border-radius: .4em; background: #fff; margin-bottom: 1em; }
  75. .m-8 { display: flex; justify-content: center; flex-flow: row wrap; border-top: 1px solid #f0f0f0; }
  76. .m-8 > .item { flex: none; width: 25%; position: relative; padding: .3em 0 .3em .6em; }
  77. .m-8 > .item > .item-tit { font-size: 1.1em; font-weight: bold; }
  78. .m-8 > .item > .item-txt { font-size: .8em; color: #7e7e7e; display: block; }
  79. .m-8 > .item img { width: 83%; margin-top: .5em; }
  80. /* 为你推荐 */
  81. .m-2 { display: flex; flex-wrap: wrap; justify-content: space-between; }
  82. .m-2 > .item { flex: none; background: #fff; width: 49.5%; margin-bottom: .3em; padding-bottom: 1em; }
  83. .m-2 > .item > .txt { font-size: .8em; color: #232326; padding: 0 .3em; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; margin-bottom: .6em; }
  84. .m-2 > .item > .price-wrap { display: flex; justify-content: space-between; margin: 0 .4em; }
  85. .m-2 > .item > .price-wrap > .price { color: #f23030; font-weight: bold; }
  86. .m-2 > .item > .price-wrap > .btn { text-align: center; color: #686868; font-size: .6em; height: 2.5em; line-height: 2.5em; padding: 0 .5em; position: relative; }
  87. .m-2 > .item > .price-wrap > .btn::after { content: ""; width: 200%; height: 200%; position: absolute; top: 0; left: 0; border: 1px solid #bfbfbf; border-radius: 4px; -webkit-transform: scale(0.5); transform: scale(0.5); -webkit-transform-origin: top left; transform-origin: top left; }
  88. .boder-after::after { height: 100%; content: ""; width: 1px; border-right: 1px solid #ddd; position: absolute; top: 0; right: 0; transform: scaleX(0.5); z-index: 10; }
  89. .gradient-red-pink { background: linear-gradient(90deg, #FF2A2A, #F139D2); -webkit-background-clip: text; color: transparent; }
  90. .gradient-pink-red { background: linear-gradient(20deg, #F139D2, #FF2A2A); -webkit-background-clip: text; color: transparent; }
  91. .gradient-blue-green { background: linear-gradient(90deg, #00C2AB, #3E94FF); -webkit-background-clip: text; color: transparent; }
  92. .gradient-green-blue { background: linear-gradient(90deg, #2AD396, #85BB1F); -webkit-background-clip: text; color: transparent; }
  93. .load-more { text-align: center; background: #f3f5f7; height: 3em; font-size: .8em; margin-bottom: .5em; width: 93vw; margin: auto; position: relative; border-top: 1px solid #ddd; padding-top: .5em; }
  94. .common { width: 100vw; background: #fff; padding: 1em 0; margin-bottom: 3.5em; }
  95. .common-links { display: flex; justify-content: space-evenly; border-bottom: 1px solid #e6e6e6; padding-bottom: 1em; }
  96. .common-links > a { flex: none; position: relative; color: #848689; font-size: .92em; padding: 0 2em; }
  97. .common-links > a::after { content: ""; height: 80%; width: 1px; background-color: #d7d7d7; position: absolute; right: 0; top: 15%; }
  98. .common-links > a:last-of-type::after { display: none; }
  99. .common-icons { display: flex; justify-content: space-around; padding: .5em 0; border-bottom: 1px solid #e6e6e6; }
  100. .common-icons > a { flex: 0 0 16%; }
  101. .common-copyright { text-align: center; color: #848689; font-size: 1.86667vw; padding: .5em 0; }
  102. .common-nav { width: 100vw; height: 3.5em; position: fixed; left: 0; bottom: 0; z-index: 99; background-color: #fff; box-shadow: 0 0 10px 0 rgba(154, 141, 141, 0.6); font-size: 16px; display: flex; justify-content: space-around; align-items: center; }
  103. .common-nav a { flex: none; width: 16%; text-align: center; }

html代码

  1. <body>
  2. <div class="slider-bg"></div>
  3. <header>
  4. <div class="search_wrapper">
  5. <div class="item">
  6. <span class="icon"></span>
  7. </div>
  8. <div class="item">
  9. <div class="searchbar">
  10. <i class="s-left icon s-input-logo"></i>
  11. <i class="s-left icon s-input-icon"></i>
  12. <form action="" method="get">
  13. <input type="text" name="" id="" placeholder="搜索商品">
  14. </form>
  15. </div>
  16. </div>
  17. <div class="item login">
  18. 登录
  19. </div>
  20. </div>
  21. <!-- 焦点图 -->
  22. <div class="focus">
  23. <ul class="hd">
  24. <li></li>
  25. <li class="on"></li>
  26. <li></li>
  27. <li></li>
  28. <li></li>
  29. <li></li>
  30. </ul>
  31. <ul class="bd">
  32. <li>
  33. <a href="">
  34. <img src="/img/focus.jpg" alt="">
  35. </a>
  36. </li>
  37. </ul class="bd">
  38. </div>
  39. </header>
  40. <!-- 导航 -->
  41. <nav class="navigation">
  42. <ul class="nav-hd">
  43. <li class="on"></li>
  44. <li></li>
  45. </ul>
  46. <div class="nav">
  47. <a href="">
  48. <img src="img/nav1.jpg" alt="">
  49. <span>京东超市</span>
  50. </a>
  51. <a href="">
  52. <img src="img/nav2.jpg" alt="">
  53. <span>数码电器</span>
  54. </a> <a href="">
  55. <img src="img/nav3.jpg" alt="">
  56. <span>京东服饰</span>
  57. </a>
  58. <a href="">
  59. <img src="img/nav4.jpg" alt="">
  60. <span>京东生鲜</span>
  61. </a>
  62. <a href="">
  63. <img src="img/nav5.jpg" alt="">
  64. <span>京东到家</span>
  65. </a>
  66. <a href="">
  67. <img src="img/nav6.jpg" alt="">
  68. <span>充值缴费</span>
  69. </a>
  70. <a href="">
  71. <img src="img/nav7.jpg" alt="">
  72. <span>9.9元拼</span>
  73. </a> <a href="">
  74. <img src="img/nav8.jpg" alt="">
  75. <span>领券</span>
  76. </a>
  77. <a href="">
  78. <img src="img/nav9.jpg" alt="">
  79. <span>赚钱</span>
  80. </a>
  81. <a href="">
  82. <img src="img/nav10.jpg" alt="">
  83. <span>PLUS会员</span>
  84. </a>
  85. </div>
  86. </nav>
  87. <!-- 秒杀 -->
  88. <section class="seckill">
  89. <div class="title_wrap">
  90. <div class="sec-tit">京东秒杀</div>
  91. <div class="sec-time-wrap">
  92. <div class="sec-time-order">10点场</div>
  93. <div class="sec-timer">00:30:08</div>
  94. </div>
  95. <div class="sec-more">
  96. 更多秒杀<i class="icon"></i>
  97. </div>
  98. </div>
  99. <div class="seckill-wrap">
  100. <ul class="sec-list">
  101. <li class="sec-item">
  102. <a href=""><img src="img/item1.jpg" alt=""></a>
  103. <span><i class="icon"></i>799</span>
  104. <span><i class="icon"></i>1299</span>
  105. </li>
  106. <li class="sec-item">
  107. <a href=""><img src="img/item2.jpg" alt=""></a>
  108. <span><i class="icon"></i>799</span>
  109. <span><i class="icon"></i>1299</span>
  110. </li>
  111. <li class="sec-item">
  112. <a href=""><img src="img/item3.jpg" alt=""></a>
  113. <span><i class="icon"></i>799</span>
  114. <span><i class="icon"></i>1299</span>
  115. </li>
  116. <li class="sec-item">
  117. <a href=""><img src="img/item4.jpg" alt=""></a>
  118. <span><i class="icon"></i>799</span>
  119. <span><i class="icon"></i>1299</span>
  120. </li>
  121. <li class="sec-item">
  122. <a href=""><img src="img/item5.jpg" alt=""></a>
  123. <span><i class="icon"></i>799</span>
  124. <span><i class="icon"></i>1299</span>
  125. </li>
  126. <li class="sec-item">
  127. <a href=""><img src="img/item6.jpg" alt=""></a>
  128. <span><i class="icon"></i>799</span>
  129. <span><i class="icon"></i>1299</span>
  130. </li>
  131. </ul>
  132. </div>
  133. </section>
  134. <!-- banner -->
  135. <section class="banner">
  136. <div class="show-banner">
  137. <a href=""><img src="img/item11.jpg" alt=""></a>
  138. <a href=""><img src="img/item12.jpg" alt=""></a>
  139. </div>
  140. </section>
  141. <section class="banner-full">
  142. <a href="">
  143. <img src="img/item13.jpg" alt="">
  144. </a>
  145. </section>
  146. <!-- 东家小院 -->
  147. <section>
  148. <img src="img/item14.jpg" alt="">
  149. </section>
  150. <section class="module-jdxy">
  151. <div class="m-two">
  152. <div class="item">
  153. <span class="item-tit">品质生活</span>
  154. <p class="item-txt">讲究是一种生活态度</p>
  155. <div class="item-img">
  156. <a href=""><img src="img/item15.jpg" alt=""></a>
  157. <a href=""><img src="img/item16.jpg" alt=""></a>
  158. </div>
  159. </div>
  160. <div class="item">
  161. <span class="item-tit">内衣洗护</span>
  162. <p class="item-txt"> 贴身衣物洗护京选好物 </p>
  163. <div class="item-img">
  164. <a href=""><img src="img/item17.jpg" alt=""></a>
  165. <a href=""><img src="img/item18.jpg" alt=""></a>
  166. </div>
  167. </div>
  168. </div>
  169. <div class="m-4">
  170. <div class="item boder-after">
  171. <span class="item-tit">4K高清</span>
  172. <span class="item-txt">品质电视</span>
  173. <a href=""><img src="img/item19.jpg" alt=""></a>
  174. </div>
  175. <div class="item boder-after">
  176. <span class="item-tit">厨房配件</span>
  177. <span class="item-txt">厨房神器</span>
  178. <a href=""><img src="img/item20.jpg" alt=""></a>
  179. </div>
  180. <div class="item boder-after">
  181. <span class="item-tit">品质宝宝</span>
  182. <span class="item-txt"> 宝宝要吃好 </span>
  183. <a href=""><img src="img/item21.jpg" alt=""></a>
  184. </div>
  185. <div class="item">
  186. <span class="item-tit">时尚男鞋</span>
  187. <span class="item-txt">舒适男鞋</span>
  188. <a href=""><img src="img/item22.jpg" alt=""></a>
  189. </div>
  190. </div>
  191. </section>
  192. <!-- 每日逛 -->
  193. <section>
  194. <img src="img/item23.jpg" alt="">
  195. </section>
  196. <div class="module-br">
  197. <div class="m-8">
  198. <div class="item boder-after">
  199. <span class="item-tit gradient-red-pink">免息星球</span>
  200. <span class="item-txt"> 白条免息购 </span>
  201. <a href=""><img src="img/item24.jpg" alt=""></a>
  202. </div>
  203. <div class="item boder-after ">
  204. <span class="item-tit gradient-red-pink">每日特价</span>
  205. <span class="item-txt "> 9块9疯抢 </span>
  206. <a href=""><img src="img/item25.jpg" alt=""></a>
  207. </div>
  208. <div class="item boder-after">
  209. <span class="item-tit gradient-red-pink">品牌闪购</span>
  210. <span class="item-txt "> 汇大牌好价 </span>
  211. <a href=""><img src="img/item26.jpg" alt=""></a>
  212. </div>
  213. <div class="item">
  214. <span class="item-tit gradient-red-pink">京东直播</span>
  215. <span class="item-txt"> 好货即刻买 </span>
  216. <a href=""><img src="img/item27.jpg" alt=""></a>
  217. </div>
  218. <div class="item boder-after">
  219. <span class="item-tit gradient-pink-red">排行榜</span>
  220. <span class="item-txt "> 热销推荐 </span>
  221. <a href=""><img src="img/item28.jpg" alt=""></a>
  222. </div>
  223. <div class="item boder-after">
  224. <span class="item-tit gradient-blue-green">拍拍好物</span>
  225. <span class="item-txt"> 二手优品 </span>
  226. <a href=""><img src="img/item29.jpg" alt=""></a>
  227. </div>
  228. <div class="item boder-after">
  229. <span class="item-tit gradient-pink-red">新品首发</span>
  230. <span class="item-txt"> 京东小魔方 </span>
  231. <a href=""><img src="img/item30.jpg" alt=""></a>
  232. </div>
  233. <div class="item">
  234. <span class="item-tit gradient-pink-red gradient-green-blue">发现好货</span>
  235. <span class="item-txt"> 教你买买买 </span>
  236. <a href=""><img src="img/item31.jpg" alt=""></a>
  237. </div>
  238. </div>
  239. </div>
  240. <!-- 为你推荐 -->
  241. <div class="module-br" style=" background-color: #f6f6f6;">
  242. <section>
  243. <img src="img/item32.jpg" alt="">
  244. </section>
  245. <div class="m-2">
  246. <div class="item">
  247. <a href=""><img src="img/item33.jpg" alt=""></a>
  248. <p class="txt">
  249. 沐凡 毛巾 4条装洗脸毛巾吸水加大加厚成人儿童亲肤素色运动柔软洗澡洁面巾擦脸巾带挂绳 35*75cm 4条装(蓝+桔+粉+咖)
  250. </p>
  251. <div class="price-wrap">
  252. <span class="price"><i class="icon"></i>29</span>
  253. <span class="btn">看相似</span>
  254. </div>
  255. </div>
  256. <div class="item">
  257. <a href=""><img src="img/item34.jpg" alt=""></a>
  258. <p class="txt">
  259. TP-LINK双千兆路由器 1900M无线家用5G双频 WDR7660千兆 六信号放大器 高速路由WIFI穿墙IPv6
  260. </p>
  261. <div class="price-wrap">
  262. <span class="price"><i class="icon"></i>129</span>
  263. <span class="btn">看相似</span>
  264. </div>
  265. </div>
  266. <div class="item">
  267. <a href=""><img src="img/item35.jpg" alt=""></a>
  268. <p class="txt">
  269. 木闻 沙发 布艺沙发北欧沙发ins实木沙发科技布沙发现代简约布艺沙发组合客厅家具 1+2+贵妃位 海绵款【麻布】 双人位+单人位+贵妃位(3.3米)
  270. </p>
  271. <div class="price-wrap">
  272. <span class="price"><i class="icon"></i>3329</span>
  273. <span class="btn">看相似</span>
  274. </div>
  275. </div>
  276. <div class="item">
  277. <a href=""><img src="img/item36.jpg" alt=""></a>
  278. <p class="txt">
  279. 英国欧乐集(Sticksology)柠檬绿茶 进口茶叶冲调饮品 袋泡茶包盒装1*15包 37.5g
  280. </p>
  281. <div class="price-wrap">
  282. <span class="price"><i class="icon"></i>56</span>
  283. <span class="btn">看相似</span>
  284. </div>
  285. </div>
  286. <div class="item">
  287. <a href=""><img src="img/item37.jpg" alt=""></a>
  288. <p class="txt">
  289. 北欧鞋柜 简约创意鞋架 源头厂家一件多功能防尘木质鞋柜家具 A款暖白色 双门 60*30*90
  290. </p>
  291. <div class="price-wrap">
  292. <span class="price"><i class="icon"></i>499</span>
  293. <span class="btn">看相似</span>
  294. </div>
  295. </div>
  296. <div class="item">
  297. <a href=""><img src="img/item38.jpg" alt=""></a>
  298. <p class="txt">
  299. 圣罗兰(YSL)细管纯口红2.2g 21#复古正红 小金条复古哑光口红 送女友 送老婆
  300. </p>
  301. <div class="price-wrap">
  302. <span class="price"><i class="icon"></i>389</span>
  303. <span class="btn">看相似</span>
  304. </div>
  305. </div>
  306. </div>
  307. </div>
  308. <!-- 底部 -->
  309. <section class="load-more">
  310. <a href="">点击继续加载</a>
  311. </section>
  312. <section class="common">
  313. <div class="common-links">
  314. <a href="">登录</a>
  315. <a href="">注册</a>
  316. <a href="">客户服务</a>
  317. <a href="">返回顶部</a>
  318. </div>
  319. <div class="common-icons">
  320. <a href="">
  321. <img src="img/item33.jpg" alt="">
  322. </a>
  323. <a href="">
  324. <img src="img/item36.jpg" alt="">
  325. </a>
  326. <a href="">
  327. <img src="img/item35.jpg" alt="">
  328. </a>
  329. </div>
  330. <div class="common-copyright">
  331. Copyright © 2004-2019 京东JD.com 版权所有
  332. </div>
  333. </section>
  334. <section class="common-nav">
  335. <a href="" class="icon">
  336. <img src="img/item40.jpg" alt="">
  337. </a>
  338. <a href="" class="icon">
  339. <img src="img/item41.jpg" alt=""></a>
  340. <a href="" class="icon">
  341. <img src="img/item42.jpg" alt="">
  342. </a>
  343. <a href="" class="icon">
  344. <img src="img/item43.jpg" alt="">
  345. </a>
  346. <a href="" class="icon">
  347. <img src="img/item44.jpg" alt="">
  348. </a>
  349. </section>
  350. </body>

完成效果

总结:通过本次联系基本掌握常用flex布局属性的使用,对主轴和副轴的概念有了明确的认识,学到了很多细节处理技巧,例如:padding,margin使用时机,伪类模拟间隔线,文本渐变背景,文本裁切,内联元素转换等。
不足之处:在移动端布局使用的计量单位em,rem,px理解还比较模糊,导致页面在切换浏览器尺寸的时候会出现上下间隔比例不同的问题。

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