当前位置:   article > 正文

用HTML和css写淘宝首页_淘宝网页制作html,css源代码

淘宝网页制作html,css源代码

目录

HTML部分

css代码 

效果图 


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. <script src="./flexible.js"></script>
  8. <link rel="stylesheet" href="./tu/font_4299446_jlvqz7brosb/iconfont.css">
  9. <script src="./tu/font_4299446_jlvqz7brosb/iconfont.js"></script>
  10. <link rel="stylesheet" href="./swiper/swiper-bundle.css">
  11. <link rel="stylesheet" href="./css/index.css">
  12. </head>
  13. <body>
  14. <header>
  15. <ul class="left">
  16. <li><a href="">中国大陆</a></li>
  17. <li><a href="./登录页.html" id="qing">亲,请登录</a></li>
  18. <li><a href="">免费注册</a></li>
  19. <li><a href="">手机逛淘宝</a></li>
  20. <li><a href="">网页无障碍</a></li>
  21. </ul>
  22. <ul class="right">
  23. <li><a href="" id="qing">淘宝网首页</a></li>
  24. <li><svg class="icon" aria-hidden="true">
  25. <use xlink:href="#icon-03f"></use>
  26. </svg><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="">免费开店</a></li>
  31. <li><a href="">千牛卖家中心</a></li>
  32. <li><a href="">联系客服</a></li>
  33. </ul>
  34. </header>
  35. <div class="nav">
  36. <div class="r-img">
  37. <img src="./img/logo.webp" alt="">
  38. </div>
  39. <div class="input">
  40. <div class="case">
  41. <input type="text" class="ipt" placeholder="枕头">
  42. <button class="btn">搜索</button>
  43. </div>
  44. <ul class="list">
  45. <li><a href="" id="ju">聚划算</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. <li><a href="">手机壳</a></li>
  54. <li><a href="">拖鞋</a></li>
  55. </ul>
  56. </div>
  57. </div>
  58. <!-- 主体 -->
  59. <div class="main">
  60. <!-- 侧边栏 -->
  61. <ul class="sidebar">
  62. <li>
  63. <div class="l-left"><img src="./img/im1.png" alt="" class="ren"><br>
  64. 女人</div>
  65. <div class="r-right"><a href="" id="smiler">连衣裙冬</a>
  66. <a href="">牛仔裤</a>
  67. <a href="">帽子</a>
  68. <a href="">鞋子</a>
  69. <a href="">长裙</a>
  70. <a href="">半身裙</a>
  71. <a href="">内搭</a>
  72. <a href="">高跟鞋</a>
  73. </div>
  74. </li>
  75. <li>
  76. <div class="l-left"><img src="./img/im2.png" alt="" class="ren"><br>
  77. 男人</div>
  78. <div class="r-right">
  79. <a href="">男鞋</a>
  80. <a href="">潮男鞋</a>
  81. <a href="">牛仔裤</a>
  82. <a href="" id="smiler">打底衫</a>
  83. <a href="">外套</a>
  84. <a href="">电动车</a>
  85. <a href="">短靴子</a>
  86. <a href="">棒球服</a>
  87. </div>
  88. </li>
  89. <li>
  90. <div class="l-left"><img src="./img/im3.png" alt="" class="ren"><br>
  91. 数码</div>
  92. <div class="r-right">
  93. <a href="">耳机</a>
  94. <a href="">洗衣机</a>
  95. <a href="">冰箱</a>
  96. <a href="">键盘</a>
  97. <a href="">护膝</a>
  98. <a href="" id="smiler">笔记本</a>
  99. <a href="">饮水机</a>
  100. <a href="">空调</a>
  101. </div>
  102. </li>
  103. <li>
  104. <div class="l-left"><img src="./img/im4.png" alt="" class="ren"><br>
  105. 母婴</div>
  106. <div class="r-right">
  107. <a href="">羽绒衣</a>
  108. <a href="">卫衣</a>
  109. <a href="">针织衫</a>
  110. <a href="" id="smiler">笔袋</a>
  111. <a href="">护膝</a>
  112. <a href="">饼干</a>
  113. <a href="">奶粉</a>
  114. <a href="">餐椅</a>
  115. </div>
  116. </li>
  117. </ul>
  118. <!-- 轮播图 -->
  119. <div class="swiper clearfix">
  120. <div class="swiper-wrapper">
  121. <div class="swiper-slide"><img src="./img/1-1.webp" alt="" id="web"></div>
  122. <div class="swiper-slide"><img src="./img/1-2.webp" alt="" id="web"></div>
  123. </div>
  124. <!-- 如果需要分页器 -->
  125. <div class="swiper-pagination"></div>
  126. <!-- 如果需要导航按钮 -->
  127. <div class="swiper-button-prev"></div>
  128. <div class="swiper-button-next"></div>
  129. <!-- 如果需要滚动条 -->
  130. <div class="swiper-scrollbar"></div>
  131. </div>
  132. <script src="./swiper/swiper-bundle.js"></script>
  133. <script>
  134. var mySwiper = new Swiper('.swiper', {
  135. // direction: 'vertical', // 垂直切换选项
  136. loop: true, // 循环模式选项
  137. // 如果需要分页器
  138. pagination: {
  139. el: '.swiper-pagination',
  140. },
  141. // 如果需要前进后退按钮
  142. navigation: {
  143. nextEl: '.swiper-button-next',
  144. prevEl: '.swiper-button-prev',
  145. },
  146. autoplay: true,
  147. // 如果需要滚动条
  148. // scrollbar: {
  149. // el: '.swiper-scrollbar',
  150. // },
  151. })
  152. </script>
  153. <!-- 主体右侧 -->
  154. <div class="wod">
  155. <img src="./img/img.png" alt="" class="slide">
  156. </div>
  157. </div>
  158. <!-- 猜你喜欢 -->
  159. <div class="cai">
  160. 猜你喜欢
  161. </div>
  162. <table>
  163. <tr>
  164. <td><img src="./img/t1.webp" alt="" class="imgt">
  165. <p><span class="tian">天猫</span><span class="taidi">泰迪狗粮小型犬比熊专用..</span></p>
  166. <p class="month">月销量过万</p>
  167. <p>到手价<span class="num">¥28</span></p>
  168. <p>月销1万+ <span class="number">¥20</span><span class="linqu">领取</span></p>
  169. </td>
  170. <td><img src="./img/t1.webp" alt="" class="imgt">
  171. <p><span class="tian">天猫</span><span class="taidi">泰迪狗粮小型犬比熊专用..</span></p>
  172. <p class="month">月销量过万</p>
  173. <p>到手价<span class="num">¥28</span></p>
  174. <p>月销1万+ <span class="number">¥20</span><span class="linqu">领取</span></p>
  175. </td>
  176. <td><img src="./img/t1.webp" alt="" class="imgt">
  177. <p><span class="tian">天猫</span><span class="taidi">泰迪狗粮小型犬比熊专用..</span></p>
  178. <p class="month">月销量过万</p>
  179. <p>到手价<span class="num">¥28</span></p>
  180. <p>月销1万+ <span class="number">¥20</span><span class="linqu">领取</span></p>
  181. </td>
  182. <td><img src="./img/t1.webp" alt="" class="imgt">
  183. <p><span class="tian">天猫</span><span class="taidi">泰迪狗粮小型犬比熊专用..</span></p>
  184. <p class="month">月销量过万</p>
  185. <p>到手价<span class="num">¥28</span></p>
  186. <p>月销1万+ <span class="number">¥20</span><span class="linqu">领取</span></p>
  187. </td>
  188. <td><img src="./img/t1.webp" alt="" class="imgt">
  189. <p><span class="tian">天猫</span><span class="taidi">泰迪狗粮小型犬比熊专用..</span></p>
  190. <p class="month">月销量过万</p>
  191. <p>到手价<span class="num">¥28</span></p>
  192. <p>月销1万+ <span class="number">¥20</span><span class="linqu">领取</span></p>
  193. </td>
  194. </tr>
  195. <tr>
  196. <td><img src="./img/t1.webp" alt="" class="imgt">
  197. <p><span class="tian">天猫</span><span class="taidi">泰迪狗粮小型犬比熊专用..</span></p>
  198. <p class="month">月销量过万</p>
  199. <p>到手价<span class="num">¥28</span></p>
  200. <p>月销1万+ <span class="number">¥20</span><span class="linqu">领取</span></p>
  201. </td>
  202. <td><img src="./img/t1.webp" alt="" class="imgt">
  203. <p><span class="tian">天猫</span><span class="taidi">泰迪狗粮小型犬比熊专用..</span></p>
  204. <p class="month">月销量过万</p>
  205. <p>到手价<span class="num">¥28</span></p>
  206. <p>月销1万+ <span class="number">¥20</span><span class="linqu">领取</span></p>
  207. </td>
  208. <td><img src="./img/t1.webp" alt="" class="imgt">
  209. <p><span class="tian">天猫</span><span class="taidi">泰迪狗粮小型犬比熊专用..</span></p>
  210. <p class="month">月销量过万</p>
  211. <p>到手价<span class="num">¥28</span></p>
  212. <p>月销1万+ <span class="number">¥20</span><span class="linqu">领取</span></p>
  213. </td>
  214. <td><img src="./img/t1.webp" alt="" class="imgt">
  215. <p><span class="tian">天猫</span><span class="taidi">泰迪狗粮小型犬比熊专用..</span></p>
  216. <p class="month">月销量过万</p>
  217. <p>到手价<span class="num">¥28</span></p>
  218. <p>月销1万+ <span class="number">¥20</span><span class="linqu">领取</span></p>
  219. </td>
  220. <td><img src="./img/t1.webp" alt="" class="imgt">
  221. <p><span class="tian">天猫</span><span class="taidi">泰迪狗粮小型犬比熊专用..</span></p>
  222. <p class="month">月销量过万</p>
  223. <p>到手价<span class="num">¥28</span></p>
  224. <p>月销1万+ <span class="number">¥20</span><span class="linqu">领取</span></p>
  225. </td>
  226. </tr>
  227. <tr>
  228. <td><img src="./img/t1.webp" alt="" class="imgt">
  229. <p><span class="tian">天猫</span><span class="taidi">泰迪狗粮小型犬比熊专用..</span></p>
  230. <p class="month">月销量过万</p>
  231. <p>到手价<span class="num">¥28</span></p>
  232. <p>月销1万+ <span class="number">¥20</span><span class="linqu">领取</span></p>
  233. </td>
  234. <td><img src="./img/t1.webp" alt="" class="imgt">
  235. <p><span class="tian">天猫</span><span class="taidi">泰迪狗粮小型犬比熊专用..</span></p>
  236. <p class="month">月销量过万</p>
  237. <p>到手价<span class="num">¥28</span></p>
  238. <p>月销1万+ <span class="number">¥20</span><span class="linqu">领取</span></p>
  239. </td>
  240. <td><img src="./img/t1.webp" alt="" class="imgt">
  241. <p><span class="tian">天猫</span><span class="taidi">泰迪狗粮小型犬比熊专用..</span></p>
  242. <p class="month">月销量过万</p>
  243. <p>到手价<span class="num">¥28</span></p>
  244. <p>月销1万+ <span class="number">¥20</span><span class="linqu">领取</span></p>
  245. </td>
  246. <td><img src="./img/t1.webp" alt="" class="imgt">
  247. <p><span class="tian">天猫</span><span class="taidi">泰迪狗粮小型犬比熊专用..</span></p>
  248. <p class="month">月销量过万</p>
  249. <p>到手价<span class="num">¥28</span></p>
  250. <p>月销1万+ <span class="number">¥20</span><span class="linqu">领取</span></p>
  251. </td>
  252. <td><img src="./img/t1.webp" alt="" class="imgt">
  253. <p><span class="tian">天猫</span><span class="taidi">泰迪狗粮小型犬比熊专用..</span></p>
  254. <p class="month">月销量过万</p>
  255. <p>到手价<span class="num">¥28</span></p>
  256. <p>月销1万+ <span class="number">¥20</span><span class="linqu">领取</span></p>
  257. </td>
  258. </tr>
  259. <tr>
  260. <td><img src="./img/t1.webp" alt="" class="imgt">
  261. <p><span class="tian">天猫</span><span class="taidi">泰迪狗粮小型犬比熊专用..</span></p>
  262. <p class="month">月销量过万</p>
  263. <p>到手价<span class="num">¥28</span></p>
  264. <p>月销1万+ <span class="number">¥20</span><span class="linqu">领取</span></p>
  265. </td>
  266. <td><img src="./img/t1.webp" alt="" class="imgt">
  267. <p><span class="tian">天猫</span><span class="taidi">泰迪狗粮小型犬比熊专用..</span></p>
  268. <p class="month">月销量过万</p>
  269. <p>到手价<span class="num">¥28</span></p>
  270. <p>月销1万+ <span class="number">¥20</span><span class="linqu">领取</span></p>
  271. </td>
  272. <td><img src="./img/t1.webp" alt="" class="imgt">
  273. <p><span class="tian">天猫</span><span class="taidi">泰迪狗粮小型犬比熊专用..</span></p>
  274. <p class="month">月销量过万</p>
  275. <p>到手价<span class="num">¥28</span></p>
  276. <p>月销1万+ <span class="number">¥20</span><span class="linqu">领取</span></p>
  277. </td>
  278. <td><img src="./img/t1.webp" alt="" class="imgt">
  279. <p><span class="tian">天猫</span><span class="taidi">泰迪狗粮小型犬比熊专用..</span></p>
  280. <p class="month">月销量过万</p>
  281. <p>到手价<span class="num">¥28</span></p>
  282. <p>月销1万+ <span class="number">¥20</span><span class="linqu">领取</span></p>
  283. </td>
  284. <td><img src="./img/t1.webp" alt="" class="imgt">
  285. <p><span class="tian">天猫</span><span class="taidi">泰迪狗粮小型犬比熊专用..</span></p>
  286. <p class="month">月销量过万</p>
  287. <p>到手价<span class="num">¥28</span></p>
  288. <p>月销1万+ <span class="number">¥20</span><span class="linqu">领取</span></p>
  289. </td>
  290. </tr>
  291. </table>
  292. <!-- 底部 -->
  293. <div class="footer">
  294. <div class="two">
  295. <ul class="two-3">
  296. <li>联系客服</li>
  297. <li>开放平台</li>
  298. <li>法律声明</li>
  299. <li>廉正举报</li>
  300. <li>Taobao.com版权所有2003-现在</li>
  301. <li>增值电信业务经营许可证:浙B2-20070195</li>
  302. <li>浙公网安备33010002000075号</li>
  303. </ul>
  304. <ul class="two-1">
  305. <li>阿里巴巴集团</li>
  306. <li>|</li>
  307. <li>淘宝网</li>
  308. <li>|</li>
  309. <li>天猫</li>
  310. <li>|</li>
  311. <li>聚划算</li>
  312. <li>|</li>
  313. <li>全球速卖通</li>
  314. <li>|</li>
  315. <li>阿里巴巴国际交易市场</li>
  316. <li>|</li>
  317. <li>1688│</li>
  318. <li>|</li>
  319. <li>阿里妈妈</li>
  320. <li>|</li>
  321. <li>飞猪</li>
  322. <li>|</li>
  323. <li>阿里云计算</li>
  324. <li>|</li>
  325. <li>AiOS</li>
  326. <li>|</li>
  327. <li>阿里通信</li>
  328. <li>|</li>
  329. <li>高德</li>
  330. <li>|</li>
  331. <li>UC</li>
  332. </ul>
  333. <ul class="two-2">
  334. <li>友盟</li>
  335. <li>|</li>
  336. <li>虾米|</li>
  337. <li>|</li>
  338. <li>钉钉</li>
  339. <li>|</li>
  340. <li>支付宝</li>
  341. <li>|</li>
  342. <li>达摩院</li>
  343. </ul>
  344. </div>
  345. </div>
  346. </body>
  347. </html>

css代码 

  1. * {
  2. padding: 0;
  3. margin: 0;
  4. text-decoration: none;
  5. list-style: none;
  6. }
  7. body {
  8. background-color: rgb(246, 246, 246);
  9. }
  10. html,
  11. body {
  12. padding: 0;
  13. margin: 0;
  14. width: 100%;
  15. height: 100%;
  16. position: absolute;
  17. left: 0;
  18. top: 0;
  19. overflow: hidden;
  20. overflow-y: auto;
  21. }
  22. /* 头部导航 */
  23. header {
  24. width: 10rem;
  25. display: flex;
  26. justify-content: space-between;
  27. }
  28. .left {
  29. display: flex;
  30. width: 2.521rem;
  31. justify-content: space-between;
  32. }
  33. #qing {
  34. color: rgb(242, 67, 26);
  35. }
  36. .right {
  37. display: flex;
  38. width: 4.2017rem;
  39. justify-content: space-between;
  40. }
  41. .left>li>a {
  42. font-size: .1008rem;
  43. color: black;
  44. }
  45. .right>li>a {
  46. font-size: .1008rem;
  47. color: black;
  48. }
  49. /* 导航 */
  50. /* logo */
  51. .r-img {
  52. margin-left: .2521rem;
  53. margin-right: .4202rem;
  54. margin-top: .1681rem;
  55. }
  56. /* 搜索框 */
  57. .input {
  58. margin-top: .1681rem;
  59. }
  60. .r-img>img {
  61. width: 1.0588rem;
  62. height: .4538rem;
  63. }
  64. .case {
  65. width: 5.7983rem;
  66. height: .3109rem;
  67. border-radius: .1555rem;
  68. border: 2px solid rgb(253, 63, 49);
  69. background-color: white;
  70. position: relative;
  71. }
  72. .ipt {
  73. width: 4.7395rem;
  74. height: .2185rem;
  75. outline: none;
  76. border: none;
  77. position: absolute;
  78. top: 1px;
  79. left: .084rem;
  80. font-size: .1008rem;
  81. }
  82. .btn {
  83. width: .6134rem;
  84. height: .2857rem;
  85. outline: none;
  86. border: none;
  87. border-radius: .1429rem;
  88. background-color: rgb(254, 79, 107);
  89. color: white;
  90. float: right;
  91. margin-top: .0168rem;
  92. font-size: .1092rem;
  93. }
  94. /* 搜索框下方导航 */
  95. .nav {
  96. width: 10rem;
  97. height: 1rem;
  98. display: flex;
  99. }
  100. .list {
  101. display: flex;
  102. width: 3.3613rem;
  103. justify-content: space-between;
  104. font-size: .1008rem;
  105. }
  106. .list>li>a {
  107. color: rgb(110, 117, 121);
  108. }
  109. #ju {
  110. color: rgb(254, 79, 107);
  111. }
  112. /* 主体 */
  113. .main {
  114. width: 10rem;
  115. height: 2.3529rem;
  116. /* background-color: aquamarine; */
  117. display: flex;
  118. }
  119. /* 侧边栏 */
  120. .sidebar {
  121. width: 2.3529rem;
  122. float: left;
  123. }
  124. .sidebar>li {
  125. height: .5882rem;
  126. display: flex;
  127. text-align: center;
  128. }
  129. .r-right>a {
  130. font-size: .1008rem;
  131. margin-right: .084rem;
  132. color: rgb(110, 107, 107);
  133. }
  134. #smiler {
  135. color: rgb(255, 63, 154);
  136. }
  137. .l-left {
  138. font-size: .1008rem;
  139. }
  140. .r-right {
  141. display: flex;
  142. flex-wrap: wrap;
  143. width: 1.9748rem;
  144. }
  145. .image {
  146. width: 5.1261rem;
  147. height: 2.3529rem;
  148. }
  149. .image>img {
  150. width: 5.1261rem;
  151. height: 2.3529rem;
  152. }
  153. .ren {
  154. width: .3782rem;
  155. height: .1513rem;
  156. }
  157. /* 中间图片 */
  158. .swiper {
  159. --swiper-theme-color: white;
  160. /* 设置Swiper风格 */
  161. --swiper-navigation-color: #eff2f0;
  162. /* 单独设置按钮颜色 */
  163. --swiper-navigation-size: .0833rem;
  164. /* 设置按钮大小 */
  165. width: 5.1261rem;
  166. height: 2.3529rem;
  167. background-color: cyan;
  168. float: left;
  169. }
  170. /* 图片大小 */
  171. #web {
  172. width: 5.1261rem;
  173. height: 2.3529rem;
  174. }
  175. /* 主体右侧 */
  176. .slide {
  177. width: 2.0084rem;
  178. height: 2.3529rem;
  179. }
  180. .wod {
  181. margin-left: .084rem;
  182. float: left;
  183. }
  184. /* 猜你喜欢 */
  185. .cai {
  186. width: 10rem;
  187. height: .3529rem;
  188. font-size: .1513rem;
  189. }
  190. /* 商品 */
  191. table {
  192. width: 10rem;
  193. border: 1px solid rgb(242, 242, 242);
  194. border-collapse: collapse;
  195. }
  196. table tr,
  197. td {
  198. width: 1.8655rem;
  199. height: 2.8235rem;
  200. background-color: white;
  201. border: 1px solid rgb(242, 242, 242);
  202. }
  203. .imgt {
  204. width: 1.7563rem;
  205. height: 1.7647rem;
  206. }
  207. p {
  208. font-size: .1008rem;
  209. color: rgb(110, 117, 121);
  210. margin-top: .042rem;
  211. margin-left: .084rem;
  212. }
  213. span {
  214. font-size: .1176rem;
  215. }
  216. .tian {
  217. font-size: .1008rem;
  218. background-color: rgb(255, 0, 53);
  219. color: white;
  220. }
  221. .month {
  222. color: rgb(254, 57, 100);
  223. width: .5042rem;
  224. height: .1429rem;
  225. background-color: rgb(254, 238, 244);
  226. }
  227. .num {
  228. font-size: .1513rem;
  229. color: rgb(255, 0, 53);
  230. }
  231. .taidi {
  232. font-size: .1176rem;
  233. color: black;
  234. }
  235. .number {
  236. display: inline-block;
  237. font-size: .1176rem;
  238. color: white;
  239. width: .437rem;
  240. height: .2185rem;
  241. background-color: rgb(255, 0, 54);
  242. margin-right: .0168rem;
  243. text-align: center;
  244. margin-left: .3361rem;
  245. }
  246. .linqu {
  247. width: .3529rem;
  248. height: .2185rem;
  249. background-color: rgb(255, 0, 54);
  250. display: inline-block;
  251. font-size: .1176rem;
  252. color: white;
  253. text-align: center;
  254. }
  255. /* 底部 */
  256. .footer {
  257. width: 10rem;
  258. margin-top: .1681rem;
  259. }
  260. .two {
  261. width: 8.2353rem;
  262. height: .7261rem;
  263. display: flex;
  264. flex-direction: column;
  265. justify-content: space-between;
  266. margin-left: .5882rem;
  267. }
  268. .two-1>Li {
  269. font-size: .1008rem;
  270. }
  271. .two-1 {
  272. display: flex;
  273. justify-content: space-between;
  274. flex-wrap: wrap;
  275. }
  276. .two-2 {
  277. display: flex;
  278. }
  279. .two-2>li {
  280. font-size: .1008rem;
  281. margin-right: .084rem;
  282. }
  283. .two>li {
  284. font-size: 12px;
  285. margin-right: .084rem;
  286. }
  287. .two-3 {
  288. display: flex;
  289. justify-content: space-between;
  290. }
  291. .two-3>Li {
  292. font-size: .1008rem;
  293. }
  294. .icon {
  295. width: 1em;
  296. height: 1em;
  297. vertical-align: -0.15em;
  298. fill: currentColor;
  299. overflow: hidden;
  300. font-size: .125rem;
  301. }

效果图 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/空白诗007/article/detail/996716
推荐阅读
相关标签
  

闽ICP备14008679号