当前位置:   article > 正文

前端(HTML + CSS)小兔鲜儿项目(仿)

前端(HTML + CSS)小兔鲜儿项目(仿)

前言

这是一个简单的商城网站,代码部分为HTML + CSS 和少量JS代码

项目总览

一、头部区域

头部的 购物车 和 手机 用的是 文字图标,所以效果可以和文字一样

购物车右上角用的是绝对定位

logo用的是 h1 标签,用来提高网站搜索排名

二、banner区域

banner区域左侧导航 :hover 和 轮播图

轮播图用了部分JS代码

三、主体区域

新鲜好物

人气推荐

热门品牌

居家

居家 :hover 为过渡

美食

服饰

母婴

最新专题

四、尾部区域-版权区域

图标没找到相应的 精灵图 所以也是用的 文字图标

源码

HTML(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:desc -->
  7. <meta name="description" content="小兔鲜儿官网,致力于打造全球最大的食品、生鲜电商购物平台">
  8. <!-- meta:kw -->
  9. <meta name="keywords" content="小兔鲜儿,食品,生鲜,服装,家电,电商,购物">
  10. <title>小兔鲜儿 - 新鲜 惠民 快捷!</title>
  11. <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
  12. <!-- 引入字体图标样式 -->
  13. <link rel="stylesheet" href="./iconfont/iconfont.css">
  14. <!-- 引入相关样式 -->
  15. <link rel="stylesheet" href="./CSS/base.css">
  16. <link rel="stylesheet" href="./CSS/common.css">
  17. <link rel="stylesheet" href="./CSS/index.css">
  18. </head>
  19. <body>
  20. <!-- 快捷导航开始 -->
  21. <div class="shortcut">
  22. <div class="wrapper">
  23. <ul>
  24. <li><a href="#">请先登录</a></li>
  25. <li><a href="#">免费注册</a></li>
  26. <li><a href="#">我的订单</a></li>
  27. <li><a href="#">会员中心</a></li>
  28. <li><a href="#">帮助中心</a></li>
  29. <li><a href="#">关于我们</a></li>
  30. <li><a href="#"><span class="iconfont icon-shouji1">手机版</span></a></li>
  31. </ul>
  32. </div>
  33. </div>
  34. <!-- 快捷导航结束 -->
  35. <!-- 头部-布局开始 -->
  36. <div class="header wrapper">
  37. <!-- logo -->
  38. <div class="logo">
  39. <h1><a href="#">小兔鲜儿</a></h1>
  40. </div>
  41. <!-- 导航 -->
  42. <div class="nav">
  43. <ul>
  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. <li><a href="#">严选</a></li>
  51. <li><a href="#">数码</a></li>
  52. <li><a href="#">运动</a></li>
  53. </ul>
  54. </div>
  55. <!-- 搜索 -->
  56. <div class="search">
  57. <span class="iconfont icon-search"></span>
  58. <input type="text" placeholder="搜一搜">
  59. </div>
  60. <!-- 购物车 -->
  61. <div class="cart">
  62. <a href="#"><span class="iconfont icon-gouwuche"></span></a>
  63. <i>6</i>
  64. </div>
  65. </div>
  66. <!-- 头部-布局结束 -->
  67. <!-- banner开始 -->
  68. <div class="banner">
  69. <div class="wrapper">
  70. <!-- 图片 -->
  71. <ul class="pic">
  72. <li><a href="#"><img src="./uploads/banner/banner1.jpg" alt=""></a></li>
  73. <li><a href="#"><img src="./uploads/banner/banner2.jpg" alt=""></a></li>
  74. <li><a href="#"><img src="./uploads/banner/banner3.jpg" alt=""></a></li>
  75. <li><a href="#"><img src="./uploads/banner/banner4.jpg" alt=""></a></li>
  76. <li><a href="#"><img src="./uploads/banner/banner5.jpg" alt=""></a></li>
  77. </ul>
  78. <!-- 箭头 -->
  79. <!-- 上一张 prev -->
  80. <a href="#" class="prev">
  81. <i class="iconfont icon-danjiantou-zuoyouqiehuan"></i>
  82. </a>
  83. <!-- 下一张 next -->
  84. <a href="#" class="next">
  85. <i class="iconfont icon-danjiantou-zuoyouqiehuan1"></i>
  86. </a>
  87. <!-- 侧导航 -->
  88. <div class="subnav">
  89. <ul>
  90. <li>
  91. <a href="#">居家</a>
  92. <a href="#">茶咖酒具</a>
  93. <a href="#">水具杯壶</a>
  94. </li>
  95. <li>
  96. <a href="#">美食</a>
  97. <a href="#">网易黑猪</a>
  98. <a href="#">水产海鲜</a>
  99. </li>
  100. <li>
  101. <a href="#">服饰</a>
  102. <a href="#">室外拖鞋</a>
  103. <a href="#">春夏潮鞋</a>
  104. </li>
  105. <li>
  106. <a href="#">母婴</a>
  107. <a href="#">T恤/polo/衬衫</a>
  108. <a href="#">卫衣/毛衫</a>
  109. </li>
  110. <li>
  111. <a href="#">个护</a>
  112. <a href="#">家庭清洁</a>
  113. <a href="#">浴室用品</a>
  114. </li>
  115. <li>
  116. <a href="#">严选</a>
  117. <a href="#">卫浴用品</a>
  118. <a href="#">高级珠宝</a>
  119. </li>
  120. <li>
  121. <a href="#">数码</a>
  122. <a href="#">影音娱乐</a>
  123. <a href="#">乐器</a>
  124. </li>
  125. <li>
  126. <a href="#">运动</a>
  127. <a href="#">登机箱</a>
  128. <a href="#">托运箱</a>
  129. </li>
  130. <li>
  131. <a href="#">杂项</a>
  132. <a href="#">乐器杂项</a>
  133. </li>
  134. <li>
  135. <a href="#">品牌</a>
  136. <a href="#">品牌推荐</a>
  137. </li>
  138. </ul>
  139. </div>
  140. <!-- 圆点指示器 -->
  141. <div class="circle"></div>
  142. </div>
  143. </div>
  144. <!-- banner结束 -->
  145. <!-- 新鲜好物开始 -->
  146. <div class="goods wrapper">
  147. <!-- 标题 -->
  148. <div class="title">
  149. <div class="left">
  150. <h3>新鲜好物</h3>
  151. <p>新鲜出炉 品质靠谱</p>
  152. </div>
  153. <div class="right">
  154. <a href="#" class="more">查看更多<span class="iconfont icon-arrow-right"></span></a>
  155. </div>
  156. </div>
  157. <!-- 内容 -->
  158. <div class="bd">
  159. <ul>
  160. <li>
  161. <a href="#">
  162. <div class="pic"><img src="./uploads/goods/goods1.jpg" alt=""></div>
  163. <div class="text">
  164. <h4>魔术盒快客杯旅行盖碗茶具套装</h4>
  165. <p>¥148.00</p>
  166. </div>
  167. </a>
  168. </li>
  169. <li>
  170. <a href="#">
  171. <div class="pic"><img src="./uploads/goods/goods2.jpg" alt=""></div>
  172. <div class="text">
  173. <h4>情侣款时尚户外轻型徒步鞋环保大底</h4>
  174. <p>¥364.00</p>
  175. </div>
  176. </a>
  177. </li>
  178. <li>
  179. <a href="#">
  180. <div class="pic"><img src="./uploads/goods/goods3.jpg" alt=""></div>
  181. <div class="text">
  182. <h4>Kenroll女士防滑夏季人字沙滩拖鞋</h4>
  183. <p>¥99.00</p>
  184. </div>
  185. </a>
  186. </li>
  187. <li>
  188. <a href="#">
  189. <div class="pic"><img src="./uploads/goods/goods4.jpg" alt=""></div>
  190. <div class="text">
  191. <h4>2021春季新品,宝宝四季连体哈衣59-90cm</h4>
  192. <p>¥55.00</p>
  193. </div>
  194. </a>
  195. </li>
  196. </ul>
  197. </div>
  198. </div>
  199. <!-- 新鲜好物结束 -->
  200. <!-- 人气推荐开始 -->
  201. <div class="recommend wrapper">
  202. <!-- 标题 -->
  203. <div class="title">
  204. <div class="left">
  205. <h3>人气推荐</h3>
  206. <p>人气爆款 不容错过</p>
  207. </div>
  208. </div>
  209. <!-- 内容 -->
  210. <div class="bd">
  211. <ul>
  212. <li>
  213. <a href="#">
  214. <div class="pic"><img src="./uploads/recommend/recommend1.jpg" alt=""></div>
  215. <div class="text">
  216. <h4>特惠推荐</h4>
  217. <p>它们最实惠</p>
  218. </div>
  219. </a>
  220. </li>
  221. <li>
  222. <a href="#">
  223. <div class="pic"><img src="./uploads/recommend/recommend2.jpg" alt=""></div>
  224. <div class="text">
  225. <h4>爆款推荐</h4>
  226. <p>它们最受欢迎</p>
  227. </div>
  228. </a>
  229. </li>
  230. <li>
  231. <a href="#">
  232. <div class="pic"><img src="./uploads/recommend/recommend3.jpg" alt=""></div>
  233. <div class="text">
  234. <h4>一站买全</h4>
  235. <p>使用场景下精心优选</p>
  236. </div>
  237. </a>
  238. </li>
  239. <li>
  240. <a href="#">
  241. <div class="pic"><img src="./uploads/recommend/recommend4.jpg" alt=""></div>
  242. <div class="text">
  243. <h4>领券中心</h4>
  244. <p>更多超值优惠券</p>
  245. </div>
  246. </a>
  247. </li>
  248. </ul>
  249. </div>
  250. </div>
  251. <!-- 人气推荐结束 -->
  252. <!-- 热门品牌开始 -->
  253. <div class="brand">
  254. <div class="wrapper">
  255. <!-- 标题 -->
  256. <div class="title">
  257. <div class="left">
  258. <h3>热门品牌</h3>
  259. <p>国际经典 品质保证</p>
  260. </div>
  261. <div class="button">
  262. <a href="#" class="prev"><span class="iconfont icon-danjiantou-zuoyouqiehuan"></span></a>
  263. <a href="#" class="next"><span class="iconfont icon-danjiantou-zuoyouqiehuan1"></span></a>
  264. </div>
  265. </div>
  266. <!-- 内容 -->
  267. <div class="bd">
  268. <ul>
  269. <li>
  270. <a href="#">
  271. <div class="pic"><img src="./uploads/热门品牌/热门品牌1.jpg" alt=""></div>
  272. </a>
  273. </li>
  274. <li>
  275. <a href="#">
  276. <div class="pic"><img src="./uploads/热门品牌/热门品牌2.jpg" alt=""></div>
  277. </a>
  278. </li>
  279. <li>
  280. <a href="#">
  281. <div class="pic"><img src="./uploads/热门品牌/热门品牌3.jpg" alt=""></div>
  282. </a>
  283. </li>
  284. <li>
  285. <a href="#">
  286. <div class="pic"><img src="./uploads/热门品牌/热门品牌4.jpg" alt=""></div>
  287. </a>
  288. </li>
  289. <li>
  290. <a href="#">
  291. <div class="pic"><img src="./uploads/热门品牌/热门品牌5.jpg" alt=""></div>
  292. </a>
  293. </li>
  294. </ul>
  295. </div>
  296. </div>
  297. </div>
  298. <!-- 热门品牌结束 -->
  299. <!-- 居家开始 -->
  300. <div class="home wrapper">
  301. <!-- 标题 -->
  302. <div class="title">
  303. <div class="left">
  304. <h3>居家</h3>
  305. </div>
  306. <div class="right">
  307. <ul>
  308. <li><a href="#">茶咖酒具</a></li>
  309. <li><a href="#">水具杯壶</a></li>
  310. <li><a href="#">宠物食品</a></li>
  311. <li><a href="#">宠物用品</a></li>
  312. </ul>
  313. <a href="#" class="more">查看更多<span class="iconfont icon-arrow-right"></span></a>
  314. </div>
  315. </div>
  316. <!-- 内容 -->
  317. <div class="content">
  318. <div class="left">
  319. <a href="#"><img src="./uploads/home/home_left.jpg" alt=""></a>
  320. </div>
  321. <div class="right">
  322. <ul>
  323. <li>
  324. <a href="#">
  325. <div class="pic"><img src="./uploads/home/home_01.jpg" alt=""></div>
  326. <div class="txt">
  327. <p class="head">日式黑陶功夫茶组双侧把茶具礼盒装</p>
  328. <p class="desc">日式风格单把设计防烫隔热美观大气</p>
  329. <p class="price">¥288.00</p>
  330. </div>
  331. </a>
  332. <!-- 产品底部 -- 过渡 -->
  333. <a href="#">
  334. <div class="cover">
  335. <p>找相似</p>
  336. <p></p>
  337. <p>发现更多宝贝<span class="iconfont icon-arrow-right"></span></p>
  338. </div>
  339. </a>
  340. </li>
  341. <li>
  342. <a href="#">
  343. <div class="pic"><img src="./uploads/home/home_02.jpg" alt=""></div>
  344. <div class="txt">
  345. <p class="head">五谷丰登好兆头白酒杯壶套装一壶五杯+骰子</p>
  346. <p class="desc">纯手工精制,每一个细节都精益求精,源自20多年经验的老师傅精心手作</p>
  347. <p class="price">¥188.00</p>
  348. </div>
  349. </a>
  350. <!-- 产品底部 -- 过渡 -->
  351. <a href="#">
  352. <div class="cover">
  353. <p>找相似</p>
  354. <p></p>
  355. <p>发现更多宝贝<span class="iconfont icon-arrow-right"></span></p>
  356. </div>
  357. </a>
  358. </li>
  359. <li>
  360. <a href="#">
  361. <div class="pic"><img src="./uploads/home/home_03.jpg" alt=""></div>
  362. <div class="txt">
  363. <p class="head">魔术盒快客杯旅行盖碗茶具套装</p>
  364. <p class="desc">轻松收纳携带方便随时随地品茶</p>
  365. <p class="price">¥148.00</p>
  366. </div>
  367. </a>
  368. <!-- 产品底部 -- 过渡 -->
  369. <a href="#">
  370. <div class="cover">
  371. <p>找相似</p>
  372. <p></p>
  373. <p>发现更多宝贝<span class="iconfont icon-arrow-right"></span></p>
  374. </div>
  375. </a>
  376. </li>
  377. <li>
  378. <a href="#">
  379. <div class="pic"><img src="./uploads/home/home_04.png" alt=""></div>
  380. <div class="txt">
  381. <p class="head">大师监制龙泉青瓷茶叶罐</p>
  382. <p class="desc">世界非遗|青瓷世家出品|釉润如玉</p>
  383. <p class="price">¥139.00</p>
  384. </div>
  385. </a>
  386. <!-- 产品底部 -- 过渡 -->
  387. <a href="#">
  388. <div class="cover">
  389. <p>找相似</p>
  390. <p></p>
  391. <p>发现更多宝贝<span class="iconfont icon-arrow-right"></span></p>
  392. </div>
  393. </a>
  394. </li>
  395. <li>
  396. <a href="#">
  397. <div class="pic"><img src="./uploads/home/home_05.jpg" alt=""></div>
  398. <div class="txt">
  399. <p class="head">电动红酒醒酒器分酒器取酒器</p>
  400. <p class="desc">贴心醒酒阀设计,随心开启,自由切换、轻松开启和关闭醒酒器功能</p>
  401. <p class="price">¥169.00</p>
  402. </div>
  403. </a>
  404. <!-- 产品底部 -- 过渡 -->
  405. <a href="#">
  406. <div class="cover">
  407. <p>找相似</p>
  408. <p></p>
  409. <p>发现更多宝贝<span class="iconfont icon-arrow-right"></span></p>
  410. </div>
  411. </a>
  412. </li>
  413. <li>
  414. <a href="#">
  415. <div class="pic"><img src="./uploads/home/home_06.png" alt=""></div>
  416. <div class="txt">
  417. <p class="head">非遗大师手作标本级六色建盏套组</p>
  418. <p class="desc">用低价一次集齐六色建盏,大师手作,盏盏精美</p>
  419. <p class="price">¥439.00</p>
  420. </div>
  421. </a>
  422. <!-- 产品底部 -- 过渡 -->
  423. <a href="#">
  424. <div class="cover">
  425. <p>找相似</p>
  426. <p></p>
  427. <p>发现更多宝贝<span class="iconfont icon-arrow-right"></span></p>
  428. </div>
  429. </a>
  430. </li>
  431. <li>
  432. <a href="#">
  433. <div class="pic"><img src="./uploads/home/home_07.png" alt=""></div>
  434. <div class="txt">
  435. <p class="head">竹制干泡茶盘正方形沥水茶台品茶盘</p>
  436. <p class="desc">干泡蓄水拆洗方便轻便实用</p>
  437. <p class="price">¥109.00</p>
  438. </div>
  439. </a>
  440. <!-- 产品底部 -- 过渡 -->
  441. <a href="#">
  442. <div class="cover">
  443. <p>找相似</p>
  444. <p></p>
  445. <p>发现更多宝贝<span class="iconfont icon-arrow-right"></span></p>
  446. </div>
  447. </a>
  448. </li>
  449. <li>
  450. <a href="#">
  451. <div class="pic"><img src="./uploads/home/home_08.jpg" alt=""></div>
  452. <div class="txt">
  453. <p class="head">与众不同的口感汝瓷白酒杯套组14</p>
  454. <p class="desc">白酒的最佳搭档,席间一道风景——汝瓷白酒套组</p>
  455. <p class="price">¥108.00</p>
  456. </div>
  457. </a>
  458. <!-- 产品底部 -- 过渡 -->
  459. <a href="#">
  460. <div class="cover">
  461. <p>找相似</p>
  462. <p></p>
  463. <p>发现更多宝贝<span class="iconfont icon-arrow-right"></span></p>
  464. </div>
  465. </a>
  466. </li>
  467. </ul>
  468. </div>
  469. </div>
  470. </div>
  471. <!-- 居家结束 -->
  472. <!-- 美食开始 -->
  473. <div class="food wrapper">
  474. <!-- 标题 -->
  475. <div class="title">
  476. <div class="left">
  477. <h3>美食</h3>
  478. </div>
  479. <div class="right">
  480. <ul>
  481. <li><a href="#">网易黑猪</a></li>
  482. <li><a href="#">水产海鲜</a></li>
  483. <li><a href="#">全球美食</a></li>
  484. <li><a href="#">冷冻冷藏</a></li>
  485. </ul>
  486. <a href="#" class="more">查看更多<span class="iconfont icon-arrow-right"></span></a>
  487. </div>
  488. </div>
  489. <!-- 内容 -->
  490. <div class="content">
  491. <div class="left">
  492. <a href="#"><img src="./uploads/food/food_left.png" alt=""></a>
  493. </div>
  494. <div class="right">
  495. <ul>
  496. <li>
  497. <a href="#">
  498. <div class="pic"><img src="./uploads/food/food_01.jpg" alt=""></div>
  499. <div class="txt">
  500. <p class="head">网易味央黑猪去骨蹄膀500g*1</p>
  501. <p class="desc">安心黑猪甄选好礼</p>
  502. <p class="price">¥65.00</p>
  503. </div>
  504. </a>
  505. <!-- 产品底部 -- 过渡 -->
  506. <a href="#">
  507. <div class="cover">
  508. <p>找相似</p>
  509. <p></p>
  510. <p>发现更多宝贝<span class="iconfont icon-arrow-right"></span></p>
  511. </div>
  512. </a>
  513. </li>
  514. <li>
  515. <a href="#">
  516. <div class="pic"><img src="./uploads/food/food_02.jpg" alt=""></div>
  517. <div class="txt">
  518. <p class="head">鲜活捕捞,爽口鱿鱼须250g*1包(约15g/根)</p>
  519. <p class="desc">鲜甜海味,低脂低热量</p>
  520. <p class="price">¥19.90</p>
  521. </div>
  522. </a>
  523. <!-- 产品底部 -- 过渡 -->
  524. <a href="#">
  525. <div class="cover">
  526. <p>找相似</p>
  527. <p></p>
  528. <p>发现更多宝贝<span class="iconfont icon-arrow-right"></span></p>
  529. </div>
  530. </a>
  531. </li>
  532. <li>
  533. <a href="#">
  534. <div class="pic"><img src="./uploads/food/food_03.jpg" alt=""></div>
  535. <div class="txt">
  536. <p class="head">网易味央黑猪猪蹄330g*1</p>
  537. <p class="desc">安心黑猪甄选好礼</p>
  538. <p class="price">¥38.90</p>
  539. </div>
  540. </a>
  541. <!-- 产品底部 -- 过渡 -->
  542. <a href="#">
  543. <div class="cover">
  544. <p>找相似</p>
  545. <p></p>
  546. <p>发现更多宝贝<span class="iconfont icon-arrow-right"></span></p>
  547. </div>
  548. </a>
  549. </li>
  550. <li>
  551. <a href="#">
  552. <div class="pic"><img src="./uploads/food/food_04.jpg" alt=""></div>
  553. <div class="txt">
  554. <p class="head">网易味央黑猪大排330g*1</p>
  555. <p class="desc">安心黑猪甄选好礼</p>
  556. <p class="price">¥37.00</p>
  557. </div>
  558. </a>
  559. <!-- 产品底部 -- 过渡 -->
  560. <a href="#">
  561. <div class="cover">
  562. <p>找相似</p>
  563. <p></p>
  564. <p>发现更多宝贝<span class="iconfont icon-arrow-right"></span></p>
  565. </div>
  566. </a>
  567. </li>
  568. <li>
  569. <a href="#">
  570. <div class="pic"><img src="./uploads/food/food_05.png" alt=""></div>
  571. <div class="txt">
  572. <p class="head">营养高蛋白鲜嫩黑鱼片300</p>
  573. <p class="desc">活鱼切片,免洗免浆</p>
  574. <p class="price">¥33.80</p>
  575. </div>
  576. </a>
  577. <!-- 产品底部 -- 过渡 -->
  578. <a href="#">
  579. <div class="cover">
  580. <p>找相似</p>
  581. <p></p>
  582. <p>发现更多宝贝<span class="iconfont icon-arrow-right"></span></p>
  583. </div>
  584. </a>
  585. </li>
  586. <li>
  587. <a href="#">
  588. <div class="pic"><img src="./uploads/food/food_06.png" alt=""></div>
  589. <div class="txt">
  590. <p class="head">中段精华,银鳕鱼切片200g</p>
  591. <p class="desc">“餐桌上的营养师”,蛋白质丰富</p>
  592. <p class="price">¥109.00</p>
  593. </div>
  594. </a>
  595. <!-- 产品底部 -- 过渡 -->
  596. <a href="#">
  597. <div class="cover">
  598. <p>找相似</p>
  599. <p></p>
  600. <p>发现更多宝贝<span class="iconfont icon-arrow-right"></span></p>
  601. </div>
  602. </a>
  603. </li>
  604. <li>
  605. <a href="#">
  606. <div class="pic"><img src="./uploads/food/food_07.jpg" alt=""></div>
  607. <div class="txt">
  608. <p class="head">个大体肥,冷冻对虾400g</p>
  609. <p class="desc">新鲜优质虾品,星级享受</p>
  610. <p class="price">¥39.90</p>
  611. </div>
  612. </a>
  613. <!-- 产品底部 -- 过渡 -->
  614. <a href="#">
  615. <div class="cover">
  616. <p>找相似</p>
  617. <p></p>
  618. <p>发现更多宝贝<span class="iconfont icon-arrow-right"></span></p>
  619. </div>
  620. </a>
  621. </li>
  622. <li>
  623. <a href="#">
  624. <div class="pic"><img src="./uploads/food/food_08.png" alt=""></div>
  625. <div class="txt">
  626. <p class="head">鲜甜海味,深海大虾200g</p>
  627. <p class="desc">人工筛选优质大虾,可做宝贝辅食</p>
  628. <p class="price">¥26.80</p>
  629. </div>
  630. </a>
  631. <!-- 产品底部 -- 过渡 -->
  632. <a href="#">
  633. <div class="cover">
  634. <p>找相似</p>
  635. <p></p>
  636. <p>发现更多宝贝<span class="iconfont icon-arrow-right"></span></p>
  637. </div>
  638. </a>
  639. </li>
  640. </ul>
  641. </div>
  642. </div>
  643. </div>
  644. <!-- 美食结束 -->
  645. <!-- 服饰开始 -->
  646. <div class="clothes wrapper">
  647. <!-- 标题 -->
  648. <div class="title">
  649. <div class="left">
  650. <h3>服饰</h3>
  651. </div>
  652. <div class="right">
  653. <ul>
  654. <li><a href="#">室外拖鞋</a></li>
  655. <li><a href="#">春夏潮鞋</a></li>
  656. <li><a href="#">飞织系列</a></li>
  657. <li><a href="#">一脚蹬懒人系列</a></li>
  658. </ul>
  659. <a href="#" class="more">查看更多<span class="iconfont icon-arrow-right"></span></a>
  660. </div>
  661. </div>
  662. <!-- 内容 -->
  663. <div class="content">
  664. <div class="left">
  665. <a href="#"><img src="./uploads/clothes/clothes_left.png" alt=""></a>
  666. </div>
  667. <div class="right">
  668. <ul>
  669. <li>
  670. <a href="#">
  671. <div class="pic"><img src="./uploads/clothes/clothes_01.jpg" alt=""></div>
  672. <div class="txt">
  673. <p class="head">Kenroll女士防滑夏季人字沙滩拖鞋</p>
  674. <p class="desc">清爽人字拖鞋,轻松夏日出行</p>
  675. <p class="price">¥39.00</p>
  676. </div>
  677. </a>
  678. <!-- 产品底部 -- 过渡 -->
  679. <a href="#">
  680. <div class="cover">
  681. <p>找相似</p>
  682. <p></p>
  683. <p>发现更多宝贝<span class="iconfont icon-arrow-right"></span></p>
  684. </div>
  685. </a>
  686. </li>
  687. <li>
  688. <a href="#">
  689. <div class="pic"><img src="./uploads/clothes/clothes_02.jpg" alt=""></div>
  690. <div class="txt">
  691. <p class="head">KENROLL室外防滑男女运动拖鞋</p>
  692. <p class="desc">潮流外穿,运动鞋型</p>
  693. <p class="price">¥19.90</p>
  694. </div>
  695. </a>
  696. <!-- 产品底部 -- 过渡 -->
  697. <a href="#">
  698. <div class="cover">
  699. <p>找相似</p>
  700. <p></p>
  701. <p>发现更多宝贝<span class="iconfont icon-arrow-right"></span></p>
  702. </div>
  703. </a>
  704. </li>
  705. <li>
  706. <a href="#">
  707. <div class="pic"><img src="./uploads/clothes/clothes_03.jpg" alt=""></div>
  708. <div class="txt">
  709. <p class="head">男女经典两带式软木拖鞋</p>
  710. <p class="desc">经典两带式,舒适不过时</p>
  711. <p class="price">¥28.80</p>
  712. </div>
  713. </a>
  714. <!-- 产品底部 -- 过渡 -->
  715. <a href="#">
  716. <div class="cover">
  717. <p>找相似</p>
  718. <p></p>
  719. <p>发现更多宝贝<span class="iconfont icon-arrow-right"></span></p>
  720. </div>
  721. </a>
  722. </li>
  723. <li>
  724. <a href="#">
  725. <div class="pic"><img src="./uploads/clothes/clothes_04.jpg" alt=""></div>
  726. <div class="txt">
  727. <p class="head">KENROLL吾皇潮趣男女室外拖鞋</p>
  728. <p class="desc">潮流吾皇万睡</p>
  729. <p class="price">¥20.90</p>
  730. </div>
  731. </a>
  732. <!-- 产品底部 -- 过渡 -->
  733. <a href="#">
  734. <div class="cover">
  735. <p>找相似</p>
  736. <p></p>
  737. <p>发现更多宝贝<span class="iconfont icon-arrow-right"></span></p>
  738. </div>
  739. </a>
  740. </li>
  741. <li>
  742. <a href="#">
  743. <div class="pic"><img src="./uploads/clothes/clothes_05.png" alt=""></div>
  744. <div class="txt">
  745. <p class="head">可机洗系列-女式尖头平底鞋</p>
  746. <p class="desc">解放双手,随盒赠送洗鞋袋</p>
  747. <p class="price">¥109.00</p>
  748. </div>
  749. </a>
  750. <!-- 产品底部 -- 过渡 -->
  751. <a href="#">
  752. <div class="cover">
  753. <p>找相似</p>
  754. <p></p>
  755. <p>发现更多宝贝<span class="iconfont icon-arrow-right"></span></p>
  756. </div>
  757. </a>
  758. </li>
  759. <li>
  760. <a href="#">
  761. <div class="pic"><img src="./uploads/clothes/clothes_06.png" alt=""></div>
  762. <div class="txt">
  763. <p class="head">情侣款经典小白鞋</p>
  764. <p class="desc">一双胜十双的穿搭利器</p>
  765. <p class="price">¥239.00</p>
  766. </div>
  767. </a>
  768. <!-- 产品底部 -- 过渡 -->
  769. <a href="#">
  770. <div class="cover">
  771. <p>找相似</p>
  772. <p></p>
  773. <p>发现更多宝贝<span class="iconfont icon-arrow-right"></span></p>
  774. </div>
  775. </a>
  776. </li>
  777. <li>
  778. <a href="#">
  779. <div class="pic"><img src="./uploads/clothes/clothes_07.png" alt=""></div>
  780. <div class="txt">
  781. <p class="head">深船型两带式可外穿软弹拖鞋</p>
  782. <p class="desc">软弹如云朵般,开天窗版透气</p>
  783. <p class="price">¥15.90</p>
  784. </div>
  785. </a>
  786. <!-- 产品底部 -- 过渡 -->
  787. <a href="#">
  788. <div class="cover">
  789. <p>找相似</p>
  790. <p></p>
  791. <p>发现更多宝贝<span class="iconfont icon-arrow-right"></span></p>
  792. </div>
  793. </a>
  794. </li>
  795. <li>
  796. <a href="#">
  797. <div class="pic"><img src="./uploads/clothes/clothes_08.jpg" alt=""></div>
  798. <div class="txt">
  799. <p class="head">KENROLL男女简洁多彩一片式室外拖</p>
  800. <p class="desc">多彩多色,夏日出行防护</p>
  801. <p class="price">¥18.80</p>
  802. </div>
  803. </a>
  804. <!-- 产品底部 -- 过渡 -->
  805. <a href="#">
  806. <div class="cover">
  807. <p>找相似</p>
  808. <p></p>
  809. <p>发现更多宝贝<span class="iconfont icon-arrow-right"></span></p>
  810. </div>
  811. </a>
  812. </li>
  813. </ul>
  814. </div>
  815. </div>
  816. </div>
  817. <!-- 服饰结束 -->
  818. <!-- 母婴开始 -->
  819. <div class="mother&baby wrapper">
  820. <!-- 标题 -->
  821. <div class="title">
  822. <div class="left">
  823. <h3>母婴</h3>
  824. </div>
  825. <div class="right">
  826. <ul>
  827. <li><a href="#">T恤/polo/衬衫</a></li>
  828. <li><a href="#">卫衣/毛衫</a></li>
  829. <li><a href="#">外套/套装</a></li>
  830. <li><a href="#">连体衣/礼盒</a></li>
  831. </ul>
  832. <a href="#" class="more">查看更多<span class="iconfont icon-arrow-right"></span></a>
  833. </div>
  834. </div>
  835. <!-- 内容 -->
  836. <div class="content">
  837. <div class="left">
  838. <a href="#"><img src="./uploads/clothes/clothes_left.png" alt=""></a>
  839. </div>
  840. <div class="right">
  841. <ul>
  842. <li>
  843. <a href="#">
  844. <div class="pic"><img src="./uploads/mother&baby/mather&baby_01.jpg" alt=""></div>
  845. <div class="txt">
  846. <p class="head">2021春季新品,宝宝四季连体哈衣59-90cm</p>
  847. <p class="desc">不同开襟方式,穿出更多花样</p>
  848. <p class="price">¥55.00</p>
  849. </div>
  850. </a>
  851. <!-- 产品底部 -- 过渡 -->
  852. <a href="#">
  853. <div class="cover">
  854. <p>找相似</p>
  855. <p></p>
  856. <p>发现更多宝贝<span class="iconfont icon-arrow-right"></span></p>
  857. </div>
  858. </a>
  859. </li>
  860. <li>
  861. <a href="#">
  862. <div class="pic"><img src="./uploads/mother&baby/mather&baby_02.jpg" alt=""></div>
  863. <div class="txt">
  864. <p class="head">儿童字母纯棉POLO衫73-130cm</p>
  865. <p class="desc">甄选100%纯棉面料,手感细腻柔软,穿着舒适透气。</p>
  866. <p class="price">¥99.00</p>
  867. </div>
  868. </a>
  869. <!-- 产品底部 -- 过渡 -->
  870. <a href="#">
  871. <div class="cover">
  872. <p>找相似</p>
  873. <p></p>
  874. <p>发现更多宝贝<span class="iconfont icon-arrow-right"></span></p>
  875. </div>
  876. </a>
  877. </li>
  878. <li>
  879. <a href="#">
  880. <div class="pic"><img src="./uploads/mother&baby/mather&baby_03.jpg" alt=""></div>
  881. <div class="txt">
  882. <p class="head">复古文艺宝宝格纹短袖衬衫73-110cm</p>
  883. <p class="desc">经典格纹,柔软舒适,清凉透气,小熊贴布,萌趣可爱</p>
  884. <p class="price">¥89.00</p>
  885. </div>
  886. </a>
  887. <!-- 产品底部 -- 过渡 -->
  888. <a href="#">
  889. <div class="cover">
  890. <p>找相似</p>
  891. <p></p>
  892. <p>发现更多宝贝<span class="iconfont icon-arrow-right"></span></p>
  893. </div>
  894. </a>
  895. </li>
  896. <li>
  897. <a href="#">
  898. <div class="pic"><img src="./uploads/mother&baby/mather&baby_04.png" alt=""></div>
  899. <div class="txt">
  900. <p class="head">毛茸茸小熊出没,儿童羊羔绒背心73-90cm</p>
  901. <p class="desc">杜邦科技棉填充,保暖舒适</p>
  902. <p class="price">¥79.00</p>
  903. </div>
  904. </a>
  905. <!-- 产品底部 -- 过渡 -->
  906. <a href="#">
  907. <div class="cover">
  908. <p>找相似</p>
  909. <p></p>
  910. <p>发现更多宝贝<span class="iconfont icon-arrow-right"></span></p>
  911. </div>
  912. </a>
  913. </li>
  914. <li>
  915. <a href="#">
  916. <div class="pic"><img src="./uploads/mother&baby/mather&baby_05.png" alt=""></div>
  917. <div class="txt">
  918. <p class="head">温暖拥抱新生,婴童杜邦棉爬服0-3</p>
  919. <p class="desc">杜邦科技棉填充,保暖舒适</p>
  920. <p class="price">¥129.00</p>
  921. </div>
  922. </a>
  923. <!-- 产品底部 -- 过渡 -->
  924. <a href="#">
  925. <div class="cover">
  926. <p>找相似</p>
  927. <p></p>
  928. <p>发现更多宝贝<span class="iconfont icon-arrow-right"></span></p>
  929. </div>
  930. </a>
  931. </li>
  932. <li>
  933. <a href="#">
  934. <div class="pic"><img src="./uploads/mother&baby/mather&baby_06.jpg" alt=""></div>
  935. <div class="txt">
  936. <p class="head">基础百搭,儿童套头针织毛衣1-9</p>
  937. <p class="desc">宽松版型,搭出休闲风格</p>
  938. <p class="price">¥119.00</p>
  939. </div>
  940. </a>
  941. <!-- 产品底部 -- 过渡 -->
  942. <a href="#">
  943. <div class="cover">
  944. <p>找相似</p>
  945. <p></p>
  946. <p>发现更多宝贝<span class="iconfont icon-arrow-right"></span></p>
  947. </div>
  948. </a>
  949. </li>
  950. <li>
  951. <a href="#">
  952. <div class="pic"><img src="./uploads/mother&baby/mather&baby_07.jpg" alt=""></div>
  953. <div class="txt">
  954. <p class="head">2021年春季新品,儿童纯棉长袖T恤73-130cm</p>
  955. <p class="desc">多色可选,童趣别致</p>
  956. <p class="price">¥59.00</p>
  957. </div>
  958. </a>
  959. <!-- 产品底部 -- 过渡 -->
  960. <a href="#">
  961. <div class="cover">
  962. <p>找相似</p>
  963. <p></p>
  964. <p>发现更多宝贝<span class="iconfont icon-arrow-right"></span></p>
  965. </div>
  966. </a>
  967. </li>
  968. <li>
  969. <a href="#">
  970. <div class="pic"><img src="./uploads/mother&baby/mather&baby_08.jpg" alt=""></div>
  971. <div class="txt">
  972. <p class="head">95%白鸭绒,儿童厚款面包羽绒服110-140cm</p>
  973. <p class="desc">三层结构防跑绒,鸭绒轻便保暖</p>
  974. <p class="price">¥439.00</p>
  975. </div>
  976. </a>
  977. <!-- 产品底部 -- 过渡 -->
  978. <a href="#">
  979. <div class="cover">
  980. <p>找相似</p>
  981. <p></p>
  982. <p>发现更多宝贝<span class="iconfont icon-arrow-right"></span></p>
  983. </div>
  984. </a>
  985. </li>
  986. </ul>
  987. </div>
  988. </div>
  989. </div>
  990. <!-- 母婴结束 -->
  991. <!-- 最新专题开始 -->
  992. <div class="topic wrapper">
  993. <!-- 标题 -->
  994. <div class="title">
  995. <div class="left">
  996. <h3>最新专题</h3>
  997. </div>
  998. <div class="right">
  999. <a href="#" class="more">查看更多<span class="iconfont icon-arrow-right"></span></a>
  1000. </div>
  1001. </div>
  1002. <!-- 内容 -->
  1003. <div class="topic-bd">
  1004. <ul>
  1005. <li>
  1006. <a href="#">
  1007. <div class="pic">
  1008. <img src="./uploads/topic/topic-1.png" alt="">
  1009. <!-- 定位区域 -->
  1010. <div class="cover">
  1011. <div class="left">
  1012. <h4>儿童3D/平面口罩 30</h4>
  1013. <p>说是儿童口罩但很大,不适合低龄儿童使用</p>
  1014. </div>
  1015. <div class="right">
  1016. <span>¥49</span>
  1017. </div>
  1018. </div>
  1019. </div>
  1020. <div class="txt">
  1021. <div class="left">
  1022. <p>
  1023. <i class="iconfont icon-aixin" style="color: rgb(255, 0, 0);"></i>
  1024. <span>5438</span>
  1025. </p>
  1026. <p>
  1027. <i class="iconfont icon-icon-test"></i>
  1028. <span>8423</span>
  1029. </p>
  1030. </div>
  1031. <div class="right">
  1032. <p>
  1033. <i class="iconfont icon-pinglun1"></i>
  1034. <span>4096</span>
  1035. </p>
  1036. </div>
  1037. </div>
  1038. </a>
  1039. </li>
  1040. <li>
  1041. <a href="#">
  1042. <div class="pic">
  1043. <img src="./uploads/topic/topic-2.png" alt="">
  1044. <!-- 定位区域 -->
  1045. <div class="cover">
  1046. <div class="left">
  1047. <h4>地表强温 男式鹅绒毛领经典派克宽松羽绒服</h4>
  1048. <p>很好,很暖和(。・ω・。)!</p>
  1049. </div>
  1050. <div class="right">
  1051. <span>¥1299</span>
  1052. </div>
  1053. </div>
  1054. </div>
  1055. <div class="txt">
  1056. <div class="left">
  1057. <p>
  1058. <i class="iconfont icon-aixin"></i>
  1059. <span>5904</span>
  1060. </p>
  1061. <p>
  1062. <i class="iconfont icon-icon-test"></i>
  1063. <span>6517</span>
  1064. </p>
  1065. </div>
  1066. <div class="right">
  1067. <p>
  1068. <i class="iconfont icon-pinglun1"></i>
  1069. <span>2543</span>
  1070. </p>
  1071. </div>
  1072. </div>
  1073. </a>
  1074. </li>
  1075. <li>
  1076. <a href="#">
  1077. <div class="pic">
  1078. <img src="./uploads/topic/topic-3.png" alt="">
  1079. <!-- 定位区域 -->
  1080. <div class="cover">
  1081. <div class="left">
  1082. <h4>煎炸蒸煮 日式双耳多用锅 小煎锅寿喜烧</h4>
  1083. <p>寿喜锅、煲仔砂陶碗以及石锅多项功能于一身的多用型选手~简即繁,外形设计较日式,更加偏向于制作寿喜烧那种菜肴的铸铁锅多一点,再加上六层压铸技术,所以还没收到的时候以为会很重,结果超轻!包装精简,女生也能美美使用~拿到锅的第一件事情必然是开锅~开锅不繁琐,效益享万年~底部也用心地印上了胖选独有的logo~熠熠生辉~严选控一本满足!锅体受热很快,较普通锑锅相比受热更加均匀,几乎同等的水能优先烧开,媲美小巧的雪平锅,但容量规格又秒杀雪平锅~锅盖两个出气的设计很好地避免了凑上去观看内部蒸煮情况时被蒸汽误伤的情形,对了!贴心地设计了两个隔热小把手套,我宣布~这多功能锅,现在就是我宝贝里面第一心头好!!!</p>
  1084. </div>
  1085. <div class="right">
  1086. <span>¥169</span>
  1087. </div>
  1088. </div>
  1089. </div>
  1090. <div class="txt">
  1091. <div class="left">
  1092. <p>
  1093. <i class="iconfont icon-aixin"></i>
  1094. <span>1134</span>
  1095. </p>
  1096. <p>
  1097. <i class="iconfont icon-icon-test"></i>
  1098. <span>6275</span>
  1099. </p>
  1100. </div>
  1101. <div class="right">
  1102. <p>
  1103. <i class="iconfont icon-pinglun1"></i>
  1104. <span>2546</span>
  1105. </p>
  1106. </div>
  1107. </div>
  1108. </a>
  1109. </li>
  1110. </ul>
  1111. </div>
  1112. </div>
  1113. <!-- 最新专题结束 -->
  1114. <!-- 尾部-布局开始 -->
  1115. <div class="footer">
  1116. <div class="wrapper">
  1117. <!-- 服务 -->
  1118. <div class="service">
  1119. <ul>
  1120. <li>
  1121. <span class="iconfont icon-kehujiage"></span>
  1122. <p>价格亲民</p>
  1123. </li>
  1124. <li>
  1125. <span class="iconfont icon-wuliu1"></span>
  1126. <p>物流快捷</p>
  1127. </li>
  1128. <li>
  1129. <span class="iconfont icon-pinzhi"></span>
  1130. <p>品质新鲜</p>
  1131. </li>
  1132. <li>
  1133. <span class="iconfont icon-shouhou2"></span>
  1134. <p>售后无忧</p>
  1135. </li>
  1136. </ul>
  1137. </div>
  1138. <!-- 帮助中心 -->
  1139. <div class="help">
  1140. <!-- 文字 -->
  1141. <div class="left">
  1142. <dl>
  1143. <dt>购物指南</dt>
  1144. <dd><a href="#">购物流程</a></dd>
  1145. <dd><a href="#">支付方式</a></dd>
  1146. <dd><a href="#">售后规则</a></dd>
  1147. </dl>
  1148. <dl>
  1149. <dt>配送方式</dt>
  1150. <dd><a href="#">配送运费</a></dd>
  1151. <dd><a href="#">配送范围</a></dd>
  1152. <dd><a href="#">配送时间</a></dd>
  1153. </dl>
  1154. <dl>
  1155. <dt>关于我们</dt>
  1156. <dd><a href="#">平台规则</a></dd>
  1157. <dd><a href="#">联系我们</a></dd>
  1158. <dd><a href="#">问题反馈</a></dd>
  1159. </dl>
  1160. <dl>
  1161. <dt>售后服务</dt>
  1162. <dd><a href="#">售后政策</a></dd>
  1163. <dd><a href="#">退款说明</a></dd>
  1164. <dd><a href="#">取消订单</a></dd>
  1165. </dl>
  1166. <dl>
  1167. <dt>服务热线</dt>
  1168. <dd><a href="#">在线客服<span class="iconfont icon-kefu"></span></a></dd>
  1169. <dd><a href="#">客服电话 400-0000-000</a></dd>
  1170. <dd><a href="#">工作时间 周一至周日 8:00-18:00</a></dd>
  1171. </dl>
  1172. </div>
  1173. <!-- 二维码 -->
  1174. <div class="right">
  1175. <ul>
  1176. <li>
  1177. <div class="pic"><span class="iconfont icon-weixin"></span></div>
  1178. <p>微信公众号</p>
  1179. </li>
  1180. <li>
  1181. <div class="pic"><img src="./images/load.jpg" alt=""></div>
  1182. <p>APP下载二维码</p>
  1183. </li>
  1184. </ul>
  1185. </div>
  1186. </div>
  1187. <!-- 版权 -->
  1188. <div class="copyright">
  1189. <p><a href="#">关于我们</a>
  1190. <a href="#">帮助中心</a>
  1191. <a href="#">售后服务</a>
  1192. <a href="#">配送与验收</a>
  1193. <a href="#">商务合作</a>
  1194. <a href="#">推荐搜索</a>
  1195. <a href="#">友情链接</a></p>
  1196. <p>CopyRight © 小兔鲜儿</p>
  1197. </div>
  1198. </div>
  1199. </div>
  1200. <!-- 尾部-布局结束 -->
  1201. </body>
  1202. <!-- 轮播图 -->
  1203. <script>
  1204. window.onload = function () {
  1205. var pic = document.querySelector('.pic');
  1206. var circle = document.querySelector('.circle');
  1207. var thisIndex = 0;
  1208. var picLi = pic.children;
  1209. var circleA = circle.children;
  1210. var flag = true;
  1211. pic.style.width = pic.children.length * 1260 + 'px';
  1212. for (var i = 0; i < pic.children.length; i++) {
  1213. var aNode = document.createElement('a');
  1214. aNode.setAttribute('index', i); //设置自定义属性
  1215. if (i == 0) {
  1216. aNode.className = 'hover';
  1217. }
  1218. circle.appendChild(aNode);
  1219. }
  1220. // 设置监视器
  1221. circle.addEventListener('click', function (e) {
  1222. if (flag) {
  1223. flag = false;
  1224. if (e.target.nodeName != 'A') {
  1225. return false;
  1226. }
  1227. thisIndex = e.target.getAttribute('index');
  1228. slow(pic, -thisIndex * 1260, function () {
  1229. flag = true;
  1230. });
  1231. circleChange();
  1232. }
  1233. })
  1234. // 自动播放
  1235. function antoChange() {
  1236. setInterval(function () {
  1237. if (flag) {
  1238. flag = false;
  1239. if (thisIndex >= circleA.length) {
  1240. thisIndex = 0;
  1241. }
  1242. slow(pic, -thisIndex * 1260, function () {
  1243. flag = true;
  1244. });
  1245. circleChange();
  1246. thisIndex++;
  1247. }
  1248. }, 2500);
  1249. }
  1250. // 圆点样式
  1251. function circleChange() {
  1252. for (var i = 0; i < circleA.length; i++) {
  1253. circleA[i].className = '';
  1254. }
  1255. circleA[thisIndex].className = 'hover';
  1256. }
  1257. function slow(obj, target, callback) {
  1258. obj.myInter = setInterval(function () {
  1259. var offsetLeft = obj.offsetLeft;
  1260. var num = (target - offsetLeft) / 10;
  1261. num > 0 ? num = Math.ceil(num) : num = Math.floor(num);
  1262. if (offsetLeft == target) {
  1263. clearInterval(obj.myInter);
  1264. callback && callback();
  1265. } else {
  1266. obj.style.left = offsetLeft + num + 'px';
  1267. }
  1268. }, 10)
  1269. }
  1270. antoChange();
  1271. }
  1272. </script>
  1273. </html>

CSS样式(base.css)代码:

  1. /* 去除常见标签默认的 margin 和 padding */
  2. * {
  3. margin: 0;
  4. padding: 0;
  5. box-sizing: border-box;
  6. }
  7. /* 设置网页统一的字体大小、行高、字体系列相关属性 */
  8. body {
  9. font: 16px/1.5 "Microsoft YaHei", "Hiragino Sans GB", "Heiti SC", "WenQuanYi Micro Hei", sans-serif;
  10. color: #333;
  11. }
  12. /* 去除列表默认样式 */
  13. h1,h2,h3,h4,h5,h6,ul,
  14. ol {
  15. list-style: none;
  16. }
  17. /* 去除默认的倾斜效果 */
  18. em,
  19. i {
  20. font-style: normal;
  21. }
  22. /* 去除a标签默认下划线,并设置默认字体颜色 */
  23. a {
  24. color: #333;
  25. text-decoration: none;
  26. }
  27. /* 设置img的垂直对齐方式为居中对齐,去除img默认下间隙 */
  28. img {
  29. vertical-align: middle;
  30. }

CSS样式(index.css)代码:

  1. /* 头尾各个页面相同的样式 */
  2. /* 版心 */
  3. .wrapper {
  4. margin: 0 auto;
  5. width: 1240px;
  6. }
  7. /* 快捷导航开始 */
  8. .shortcut {
  9. height: 52px;
  10. background-color: #333;
  11. }
  12. .shortcut .wrapper {
  13. display: flex;
  14. justify-content: flex-end;
  15. height: 52px;
  16. }
  17. .shortcut ul {
  18. display: flex;
  19. line-height: 52px;
  20. }
  21. .shortcut li a {
  22. padding: 0 15px;
  23. border-left: 1px solid #666;
  24. font-size: 14px;
  25. color: #cdcdcd;
  26. }
  27. .shortcut li:first-child a {
  28. border-left: 0;
  29. }
  30. .shortcut li a:hover{
  31. color: #27ba9b;
  32. }
  33. /* 快捷导航结束 */
  34. /* 头部-布局开始 */
  35. .header {
  36. display: flex;
  37. margin-top: 22px;
  38. margin-bottom: 22px;
  39. height: 88px;
  40. }
  41. /* logo开始 */
  42. .logo {
  43. margin-right: 40px;
  44. width: 200px;
  45. height: 88px;
  46. }
  47. .logo a {
  48. display: block;
  49. width: 200px;
  50. height: 88px;
  51. background-image: url(../images/logo.png);
  52. background-size: 200px 88px;
  53. font-size: 0;
  54. }
  55. /* logo结束 */
  56. /* 导航开始 */
  57. .nav {
  58. margin-top: 33px;
  59. margin-right: 28px;
  60. }
  61. .nav ul {
  62. display: flex;
  63. }
  64. .nav li {
  65. margin-right: 47px;
  66. }
  67. .nav li a {
  68. padding-bottom: 10px;
  69. }
  70. .nav li a:hover {
  71. color: #27ba9b;
  72. border-bottom: 2px solid #27ba9b;
  73. }
  74. /* 导航结束 */
  75. /* 搜索开始 */
  76. .search {
  77. display: flex;
  78. margin-top: 33px;
  79. margin-right: 45px;
  80. width: 170px;
  81. height: 34px;
  82. border-bottom: 2px solid #f4f4f4;
  83. }
  84. .search .iconfont {
  85. margin-right: 8px;
  86. font-size: 18px;
  87. color: #333;
  88. }
  89. .search input {
  90. /* 浏览器优先生效 input 标签的默认宽度,所有 flex:1 不生效 */
  91. /* 解决办法:重置 input 默认宽度 → width:0 */
  92. flex: 1;
  93. width: 0;
  94. border: none;
  95. outline: none;
  96. }
  97. .search input::placeholder {
  98. font-size: 16px;
  99. color: #ccc;
  100. border: none;
  101. }
  102. /* 搜索结束 */
  103. /* 购物车开始 */
  104. .cart {
  105. position: relative;
  106. margin-top: 32px;
  107. }
  108. .cart .iconfont {
  109. font-size: 24px;
  110. }
  111. .cart i {
  112. position: absolute;
  113. top: 0;
  114. /* ringht 定位右对齐:如果文字多了,向左撑开,可能盖住其他内容 */
  115. /* right: 0; */
  116. /* left 定位左对齐:如果文字多了,向右撑开, */
  117. left: 18px;
  118. padding: 1px 6px;
  119. line-height: 1;
  120. background: #e26237;
  121. color: #fff;
  122. font-size: 12px;
  123. border-radius: 10px;
  124. }
  125. /* 购物车结束 */
  126. /* 头部-布局结束 */
  127. /* 尾部-布局开始 */
  128. .footer {
  129. height: 580px;
  130. background-color: #f5f5f5;
  131. }
  132. /* 服务开始 */
  133. .service {
  134. padding: 60px 0;
  135. height: 178px;
  136. border-bottom: 1px solid #e8e8e8;
  137. }
  138. .service ul {
  139. display: flex;
  140. justify-content: space-evenly;
  141. }
  142. .service li {
  143. display: flex;
  144. width: 190px;
  145. height: 58px;
  146. }
  147. .service li .iconfont {
  148. margin-right: 20px;
  149. width: 58px;
  150. height: 58px;
  151. border: 2px solid #27ba9b;
  152. color: #27ba9b;
  153. border-radius: 50%;
  154. font-size: 30px;
  155. text-align: center;
  156. line-height: 58px;
  157. }
  158. .service li:first-child .iconfont {
  159. padding-left: 2px;
  160. }
  161. .service li p {
  162. line-height: 58px;
  163. font-size: 28px;
  164. }
  165. /* 服务结束 */
  166. /* 帮助中心开始 */
  167. .help {
  168. display: flex;
  169. justify-content: space-between;
  170. padding-top: 60px;
  171. height: 300px;
  172. }
  173. /* 文字开始 */
  174. .help .left {
  175. display: flex;
  176. }
  177. .help .left dl {
  178. margin-right: 84px;
  179. }
  180. .help .left dl:last-child {
  181. margin-right: 0;
  182. }
  183. .help .left dt {
  184. margin-bottom: 30px;
  185. font-size: 18px;
  186. }
  187. .help .left dd {
  188. margin-bottom: 10px;
  189. }
  190. .help .left a {
  191. font-size: 16px;
  192. color: #969696;
  193. }
  194. .help .left a:hover {
  195. color: #27ba9b;
  196. }
  197. .help .left a .iconfont {
  198. margin-left: 5px;
  199. color: #72d0ff;
  200. }
  201. /* 文字结束 */
  202. /* 二维码开始 */
  203. .help .right ul {
  204. display: flex;
  205. }
  206. .help .right li:first-child {
  207. margin-left: 84px;
  208. margin-right: 55px;
  209. }
  210. .help .right .pic {
  211. padding-top: 10px;
  212. margin-bottom: 10px;
  213. width: 120px;
  214. height: 120px;
  215. border: 1px solid #eae0e0;
  216. }
  217. .help .right .iconfont {
  218. margin-left: 16px;
  219. font-size: 72px;
  220. color: #666;
  221. }
  222. .help .right .iconfont:hover {
  223. color: #27ba9b;
  224. cursor: pointer;
  225. }
  226. .help .right img {
  227. margin-left: 10px;
  228. width: 100px;
  229. height: 100x;
  230. }
  231. .help .right p {
  232. color: #999;
  233. text-align: center;
  234. }
  235. /* 二维码结束 */
  236. /* 帮助中心结束 */
  237. /* 版权开始 */
  238. .copyright p {
  239. margin-bottom: 20px;
  240. color: #999;
  241. line-height: 1;
  242. text-align: center;
  243. }
  244. .copyright a {
  245. padding: 0 10px;
  246. color: #999;
  247. border-right: 1px solid #999;
  248. }
  249. .copyright a:hover {
  250. color: #27ba9b;
  251. }
  252. .copyright a:last-child {
  253. border-right: 0;
  254. }
  255. /* 版权结束 */
  256. /* 尾部-布局结束 */

CSS样式(index.css)代码:

  1. /* 首页内容样式 */
  2. /* banner开始 */
  3. .banner {
  4. height: 500px;
  5. background-color: #f5f5f5;
  6. }
  7. .banner .wrapper {
  8. position: relative;
  9. height: 500px;
  10. overflow: hidden;
  11. }
  12. /* 图片开始 */
  13. .banner .pic {
  14. position: absolute;
  15. }
  16. .banner .pic li {
  17. float: left;
  18. margin-right: 20px;
  19. }
  20. /* 图片结束 */
  21. /* 箭头开始 */
  22. .banner .prev,
  23. .banner .next {
  24. /* 隐藏 */
  25. display: none;
  26. position: absolute;
  27. top: 50%;
  28. transform: translateY(-50%);
  29. width: 44px;
  30. height: 44px;
  31. text-align: center;
  32. line-height: 44px;
  33. border-radius: 50%;
  34. color: #fff;
  35. background-color: rgba(0, 0, 0, 0.2);
  36. }
  37. /* 鼠标滑到banner区域,箭头要显示 display:block */
  38. .banner .wrapper:hover .prev,
  39. .banner .wrapper:hover .next {
  40. display: block;
  41. }
  42. .banner .prev {
  43. left: 270px;
  44. }
  45. .banner .next {
  46. right: 20px;
  47. }
  48. .banner .iconfont {
  49. font-size: 20px;
  50. }
  51. /* 箭头结束 */
  52. /* 侧导航开始 */
  53. .subnav {
  54. position: absolute;
  55. top: 0;
  56. left: 0;
  57. width: 250px;
  58. height: 500px;
  59. background-color: rgba(0, 0, 0, 0.8);
  60. }
  61. .subnav li {
  62. padding-left: 40px;
  63. height: 50px;
  64. line-height: 50px;
  65. }
  66. .subnav li:hover {
  67. background-color: #27ba9b;
  68. }
  69. .subnav li a:first-child {
  70. font-size: 16px;
  71. }
  72. .subnav li a {
  73. color: #fff;
  74. font-size: 14px;
  75. }
  76. /* 侧导航结束 */
  77. /* 圆点指示器开始 */
  78. .circle {
  79. padding-left: 250px;
  80. position: absolute;
  81. bottom: 20px;
  82. left: 50%;
  83. transform: translateX(-50%);
  84. cursor: pointer;
  85. }
  86. .circle a {
  87. margin-right: 12px;
  88. width: 12px;
  89. height: 12px;
  90. background-color: rgba(0, 0, 0, 0.3);
  91. display: block;
  92. border-radius: 50%;
  93. float: left;
  94. }
  95. .circle a.hover {
  96. background-color: #fff;
  97. }
  98. /* 圆点指示器结束 */
  99. /* banner结束 */
  100. /* 新鲜好物开始 */
  101. /* 标题开始 -- 公共样式 */
  102. .title {
  103. display: flex;
  104. justify-content: space-between;
  105. margin: 40px 0;
  106. height: 42px;
  107. }
  108. .title .left {
  109. display: flex;
  110. }
  111. .title .left h3 {
  112. font-size: 30px;
  113. margin-left: 6px;
  114. font-weight: normal;
  115. }
  116. .title .left p {
  117. margin-left: 20px;
  118. align-self: flex-end;
  119. color: #999;
  120. }
  121. .title .right .more {
  122. line-height: 42px;
  123. color: #999;
  124. }
  125. .title .right .more:hover {
  126. color: #27ba9b;
  127. }
  128. .title .right .more .iconfont {
  129. margin-left: 6px;
  130. }
  131. /* 标题结束 */
  132. /* 内容开始 -- 公共样式 */
  133. .bd ul {
  134. display: flex;
  135. justify-content: space-between;
  136. }
  137. .bd li {
  138. width: 306px;
  139. height: 406px;
  140. background-color: #f0f9f4;
  141. transition: all 0.5s;
  142. }
  143. .goods .bd li:hover,
  144. .recommend .bd li:hover,
  145. .topic .topic-bd li:hover {
  146. box-shadow: 0 5px 10px 1px rgba(0, 0, 0, 0.2);
  147. }
  148. .bd li img {
  149. width: 306px;
  150. height: 306px;
  151. max-width: 100%;
  152. max-height: 100%;
  153. transition: all 0.5s;
  154. }
  155. .bd li .text {
  156. text-align: center;
  157. font-size: 22px;
  158. white-space: nowrap;
  159. }
  160. .bd li .text h4 {
  161. width: 306px;
  162. height: 42.8px;
  163. padding: 12px 30px 0;
  164. font-weight: normal;
  165. overflow: hidden;
  166. text-overflow: ellipsis;
  167. }
  168. .bd li .text p {
  169. padding: 12px 30px 0;
  170. color: #cf4444;
  171. }
  172. /* 内容结束 */
  173. /* 新鲜好物结束 */
  174. /* 人气推荐开始 */
  175. .recommend {
  176. margin-bottom: 20px;
  177. }
  178. .recommend .bd li {
  179. transition: all 0.5s;
  180. background-color: #fff;
  181. }
  182. .recommend li .text p {
  183. color: #999;
  184. font-size: 18px;
  185. }
  186. /* 人气推荐结束 */
  187. /* 热门品牌开始 */
  188. .brand {
  189. background-color: #f5f5f5;
  190. height: 468px;
  191. }
  192. .brand .wrapper {
  193. overflow: hidden;
  194. }
  195. /* 标题开始 */
  196. .brand .title {
  197. position: relative;
  198. }
  199. .brand .title .left {
  200. height: 42px;
  201. }
  202. .brand .button {
  203. position: absolute;
  204. right: 0;
  205. bottom: 0;
  206. /* 让 a 在一行显示,宽高生效 */
  207. display: flex;
  208. }
  209. .brand .button a {
  210. margin-left: 5px;
  211. width: 20px;
  212. height: 20px;
  213. color: #fff;
  214. text-align: center;
  215. line-height: 20px;
  216. }
  217. .brand .button .prev {
  218. background-color: #ccc;
  219. }
  220. .brand .button .next {
  221. background-color: #27ba9b;
  222. }
  223. /* 标题结束 */
  224. /* 内容开始 */
  225. .brand .bd li {
  226. width: 240px;
  227. height: 305px;
  228. margin-bottom: 40px;
  229. }
  230. .brand .bd img {
  231. width: 240px;
  232. height: 305px;
  233. }
  234. /* 内容结束 */
  235. /* 热门品牌结束 */
  236. /* 居家开始 */
  237. /* 标题开始 */
  238. .title .right {
  239. display: flex;
  240. }
  241. /* 右侧导航 -- 公共样式 */
  242. .title .right ul {
  243. display: flex;
  244. }
  245. .title .right li {
  246. line-height: 42px;
  247. text-align: center;
  248. }
  249. .title .right li:last-child {
  250. margin-right: 80px;
  251. }
  252. .title .right li a {
  253. padding: 2px 12px;
  254. border-radius: 4px;
  255. }
  256. .title .right li a:hover {
  257. color: #fff;
  258. background-color: #27ba9b;
  259. }
  260. /* 标题结束 */
  261. /* 内容开始 -- 公共样式 */
  262. .content {
  263. display: flex;
  264. justify-content: space-between;
  265. }
  266. .content .left img {
  267. width: 240px;
  268. height: 610px;
  269. }
  270. .content .right {
  271. width: 990px;
  272. height: 610px;
  273. }
  274. .content .right ul {
  275. display: flex;
  276. justify-content: space-between;
  277. flex-wrap: wrap;
  278. }
  279. .content .right li {
  280. position: relative;
  281. padding: 10px 30px;
  282. width: 242px;
  283. height: 303px;
  284. border: 1px solid transparent;
  285. overflow: hidden;
  286. }
  287. .content .right li:hover {
  288. border: 1px solid #27ba9b;
  289. }
  290. .content .right li:nth-child(-n+4) {
  291. margin-bottom: 4px;
  292. border-bottom: 1px solid #27ba9a74;
  293. }
  294. .content .pic img {
  295. margin: 0 10px;
  296. width: 160px;
  297. height: 160px;
  298. }
  299. .content .txt p {
  300. margin-top: 6px;
  301. }
  302. .content .txt .head {
  303. height: 44px;
  304. }
  305. .content .txt .desc {
  306. text-wrap: nowrap;
  307. text-overflow: ellipsis;
  308. overflow: hidden;
  309. color: #666;
  310. }
  311. .content .txt .price {
  312. margin-top: 10px;
  313. color: #cf4444;
  314. font-size: 20px;
  315. }
  316. /* 产品底部 -- 过渡开始 */
  317. .content li .cover {
  318. position: absolute;
  319. left: 0;
  320. bottom: -84px;
  321. padding-top: 15px;
  322. width: 241.6px;
  323. height: 84px;
  324. background-color: #27ba9b;
  325. text-align: center;
  326. color: #fff;
  327. /* 过渡 */
  328. transition: all 0.55s;
  329. }
  330. .content .cover p:first-child {
  331. font-size: 18px;
  332. }
  333. .content .cover p:nth-child(2) {
  334. margin: 5px auto 3px;
  335. width: 120px;
  336. height: 1px;
  337. background-color: #fff;
  338. }
  339. .content .cover p:nth-child(3) {
  340. font-size: 13px;
  341. }
  342. .content .cover p:nth-child(3) .iconfont {
  343. margin-left: 2px;
  344. font-size: 12px;
  345. }
  346. /* 鼠标悬停到li,显示cover,改变位置 */
  347. .content .right li:hover .cover {
  348. bottom: 0;
  349. }
  350. /* 产品底部 -- 过渡结束 */
  351. /* 内容结束 */
  352. /* 居家结束 */
  353. /* 最新专题开始 */
  354. .topic-bd {
  355. margin-bottom: 40px;
  356. }
  357. .topic-bd ul {
  358. display: flex;
  359. justify-content: space-between;
  360. }
  361. .topic-bd li {
  362. width: 405px;
  363. height: 360px;
  364. transition: all 0.5s;
  365. }
  366. .topic-bd .pic {
  367. position: relative;
  368. }
  369. .topic-bd .pic img {
  370. width: 405px;
  371. height: 288px;
  372. }
  373. .topic-bd .txt {
  374. display: flex;
  375. justify-content: space-between;
  376. align-items: center;
  377. padding: 0 20px;
  378. width: 405px;
  379. height: 72px;
  380. background-color: #f5f5f5;
  381. color: #999;
  382. }
  383. .topic-bd .txt .iconfont {
  384. font-size: 18px;
  385. }
  386. .topic-bd .txt .left {
  387. display: flex;
  388. }
  389. .topic-bd .txt .left p {
  390. margin-right: 25px;
  391. }
  392. /* 定位区域 -- 文字开始 */
  393. .topic-bd .cover {
  394. position: relative;
  395. position: absolute;
  396. left: 0;
  397. bottom: 0;
  398. display: flex;
  399. justify-content: space-between;
  400. align-items: center;
  401. padding: 0 16px;
  402. width: 405px;
  403. height: 100px;
  404. background-image: linear-gradient(180deg, rgba(137, 137, 137, 0.00) 0%,
  405. rgba(0, 0, 0, 0.90) 100%);
  406. }
  407. .topic-bd .cover .left {
  408. position: absolute;
  409. bottom: 0;
  410. padding-bottom: 16px;
  411. width: 70%;
  412. }
  413. .topic-bd .cover .left h4 {
  414. font-weight: normal;
  415. font-size: 22px;
  416. color: #fff;
  417. text-wrap: nowrap;
  418. overflow: hidden;
  419. text-overflow: ellipsis;
  420. }
  421. .topic-bd .cover .left p {
  422. font-size: 19px;
  423. color: #999;
  424. text-wrap: nowrap;
  425. overflow: hidden;
  426. text-overflow: ellipsis;
  427. }
  428. .topic-bd .cover .right {
  429. position: absolute;
  430. bottom: 25px;
  431. right: 16px;
  432. padding: 4px 8px 4px 7px;
  433. line-height: 1;
  434. font-size: 17px;
  435. color: #cf4444;
  436. background-color: #fff;
  437. border-radius: 2px;
  438. }
  439. /* 定位区域 -- 文字结束 */
  440. /* 最新专题结束 */
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/IT小白/article/detail/956865
推荐阅读
相关标签
  

闽ICP备14008679号