博客列表 >淘宝pc端

淘宝pc端

PHui
PHui原创
2022年11月02日 17:07:12343浏览
  1. <div class="wrap">
  2. <!-- (1) 头部 -->
  3. <header>
  4. <!-- 1. 顶部导航 -->
  5. <div class="top">
  6. <div class="content"></div>
  7. </div>
  8. <!-- 2. 快速入口 -->
  9. <div class="entry">
  10. <div class="content">
  11. <div class="item logo"></div>
  12. <div class="item"></div>
  13. <div class="item"></div>
  14. <div class="item"></div>
  15. <div class="item"></div>
  16. <div class="item"></div>
  17. </div>
  18. </div>
  19. </header>
  20. <!-- (2) 主体 -->
  21. <main>
  22. <!-- 1. 搜索框 -->
  23. <div class="search">
  24. <div class="item logo"></div>
  25. <div class="item input"></div>
  26. <div class="item ewm"></div>
  27. </div>
  28. <!-- 2. 导航区 -->
  29. <div class="navs">
  30. <!-- 1. 左侧分类 -->
  31. <div class="cate"></div>
  32. <!-- 2. 在侧轮播图与用户信息 -->
  33. <div class="user">
  34. <!-- 1. 顶部导航 -->
  35. <div class="user-top"></div>
  36. <!-- 左侧轮播图 -->
  37. <div class="slider"></div>
  38. <!-- 右侧用户信息 -->
  39. <div class="user-info"></div>
  40. </div>
  41. </div>
  42. <!-- 3. 标题区 -->
  43. <div class="title">
  44. <h2>猜你喜欢</h2>
  45. <div class="tag">个性推荐</div>
  46. </div>
  47. <!-- 4. 商品列表 -->
  48. <div class="list">
  49. <div class="item">
  50. <a href=""><img src="" alt="" /></a>
  51. <div class="detail">
  52. <div class="desc">商品描述商品描述商品描述商品描述</div>
  53. <div class="price">159</div>
  54. </div>
  55. </div>
  56. <div class="item">
  57. <a href=""><img src="" alt="" /></a>
  58. <div class="detail">
  59. <div class="desc">商品描述商品描述商品描述商品描述</div>
  60. <div class="price">159</div>
  61. </div>
  62. </div>
  63. <div class="item">
  64. <a href=""><img src="" alt="" /></a>
  65. <div class="detail">
  66. <div class="desc">商品描述商品描述商品描述商品描述</div>
  67. <div class="price">159</div>
  68. </div>
  69. </div>
  70. <div class="item">
  71. <a href=""><img src="" alt="" /></a>
  72. <div class="detail">
  73. <div class="desc">商品描述商品描述商品描述商品描述</div>
  74. <div class="price">159</div>
  75. </div>
  76. </div>
  77. <div class="item">
  78. <a href=""><img src="" alt="" /></a>
  79. <div class="detail">
  80. <div class="desc">商品描述商品描述商品描述商品描述</div>
  81. <div class="price">159</div>
  82. </div>
  83. </div>
  84. <div class="item">
  85. <a href=""><img src="" alt="" /></a>
  86. <div class="detail">
  87. <div class="desc">商品描述商品描述商品描述商品描述</div>
  88. <div class="price">159</div>
  89. </div>
  90. </div>
  91. <div class="item">
  92. <a href=""><img src="" alt="" /></a>
  93. <div class="detail">
  94. <div class="desc">商品描述商品描述商品描述商品描述</div>
  95. <div class="price">159</div>
  96. </div>
  97. </div>
  98. <div class="item">
  99. <a href=""><img src="" alt="" /></a>
  100. <div class="detail">
  101. <div class="desc">商品描述商品描述商品描述商品描述</div>
  102. <div class="price">159</div>
  103. </div>
  104. </div>
  105. <div class="item">
  106. <a href=""><img src="" alt="" /></a>
  107. <div class="detail">
  108. <div class="desc">商品描述商品描述商品描述商品描述</div>
  109. <div class="price">159</div>
  110. </div>
  111. </div>
  112. <div class="item">
  113. <a href=""><img src="" alt="" /></a>
  114. <div class="detail">
  115. <div class="desc">商品描述商品描述商品描述商品描述</div>
  116. <div class="price">159</div>
  117. </div>
  118. </div>
  119. <div class="item">
  120. <a href=""><img src="" alt="" /></a>
  121. <div class="detail">
  122. <div class="desc">商品描述商品描述商品描述商品描述</div>
  123. <div class="price">159</div>
  124. </div>
  125. </div>
  126. <div class="item">
  127. <a href=""><img src="" alt="" /></a>
  128. <div class="detail">
  129. <div class="desc">商品描述商品描述商品描述商品描述</div>
  130. <div class="price">159</div>
  131. </div>
  132. </div>
  133. <div class="item">
  134. <a href=""><img src="" alt="" /></a>
  135. <div class="detail">
  136. <div class="desc">商品描述商品描述商品描述商品描述</div>
  137. <div class="price">159</div>
  138. </div>
  139. </div>
  140. <div class="item">
  141. <a href=""><img src="" alt="" /></a>
  142. <div class="detail">
  143. <div class="desc">商品描述商品描述商品描述商品描述</div>
  144. <div class="price">159</div>
  145. </div>
  146. </div>
  147. <div class="item">
  148. <a href=""><img src="images/items/item-11.webp" alt="" /></a>
  149. <div class="detail">
  150. <div class="desc">商品描述商品描述商品描述商品描述</div>
  151. <div class="price">159</div>
  152. </div>
  153. </div>
  154. <div class="item">
  155. <a href=""><img src="" alt="" /></a>
  156. <div class="detail">
  157. <div class="desc">商品描述商品描述商品描述商品描述</div>
  158. <div class="price">159</div>
  159. </div>
  160. </div>
  161. <div class="item">
  162. <a href=""><img src="" alt="" /></a>
  163. <div class="detail">
  164. <div class="desc">商品描述商品描述商品描述商品描述</div>
  165. <div class="price">159</div>
  166. </div>
  167. </div>
  168. </div>
  169. </main>
  170. </div>
  1. * {
  2. margin: 0;
  3. padding: 0;
  4. box-sizing: border-box;
  5. }
  6. body {
  7. min-height: 3000px;
  8. }
  9. /* 头部:导航 */
  10. .wrap header .top {
  11. width: 100%;
  12. height: 36px;
  13. background-color: pink;
  14. }
  15. .wrap header .top .content {
  16. width: 1190px;
  17. height: inherit;
  18. margin: auto;
  19. display: flex;
  20. place-content: space-between;
  21. background-color: blue;
  22. }
  23. .wrap header .top .content .left {
  24. display: flex;
  25. place-items: center;
  26. }
  27. .wrap header .top .content .left span,
  28. .wrap header .top .content .right span {
  29. margin: 5px;
  30. }
  31. /* 头部:快速入口 */
  32. .wrap header .entry {
  33. height: 100px;
  34. width: 1190px;
  35. padding: 15px;
  36. background-color: #ff727c;
  37. margin: 10px auto;
  38. padding: 10px;
  39. }
  40. .wrap header .entry .content {
  41. max-width: 1190px;
  42. min-width: 950px;
  43. height: inherit;
  44. margin: auto;
  45. display: grid;
  46. grid-template-columns: 80px repeat(5, 1fr);
  47. grid-auto-rows: 80px;
  48. gap: 10px;
  49. /* background-color: #fea775; */
  50. /* padding: 10px; */
  51. }
  52. .wrap header .entry .content .item {
  53. background-color: #bb727c;
  54. border-radius: 15px;
  55. height: 75px;
  56. }
  57. .wrap header .entry .content .item.logo img,
  58. .wrap header .entry .content .item.entry img {
  59. width: 100%;
  60. }
  61. .wrap header .entry .content .item.entry {
  62. color: white;
  63. background-color: #fea775;
  64. display: grid;
  65. grid-template-columns: 1fr 70px;
  66. padding: 5px;
  67. }
  68. /* 主体 */
  69. .wrap main {
  70. max-width: 1190px;
  71. min-width: 950px;
  72. min-inline-size: 1000px;
  73. margin: auto;
  74. padding: 20px;
  75. background-color: green;
  76. }
  77. /* 搜索框 */
  78. .wrap main .search {
  79. height: 88px;
  80. display: grid;
  81. grid-template-columns: 190px 1fr 90px;
  82. /* place-items: center; */
  83. gap: 10px;
  84. /* 粘性定位 */
  85. position: sticky;
  86. top: 0;
  87. }
  88. .wrap main .search .item {
  89. background-color: #ffffff;
  90. }
  91. .wrap main .search .item .icon-taobaowang {
  92. color: orange;
  93. font-size: xx-large;
  94. }
  95. /* 导航区 */
  96. .wrap main .navs {
  97. height: 423px;
  98. margin: 20px 0;
  99. display: grid;
  100. grid-template-columns: 270px 1fr;
  101. gap: 10px;
  102. }
  103. .wrap main .navs > * {
  104. background-color: lightskyblue;
  105. }
  106. .wrap main .navs .cate {
  107. display: grid;
  108. grid-template-rows: repeat(9, 1fr);
  109. gap: 10px;
  110. }
  111. .wrap main .navs .cate > * {
  112. background-color: aliceblue;
  113. }
  114. /* 用户信息及轮播图 */
  115. .wrap main .navs .user {
  116. display: grid;
  117. grid-template-columns: 564px 1fr;
  118. grid-template-rows: 42px 1fr;
  119. gap: 10px;
  120. }
  121. .wrap main .navs .user > * {
  122. background-color: aliceblue;
  123. }
  124. .wrap main .navs .user-top {
  125. grid-column: span 2;
  126. display: grid;
  127. grid-template-columns: repeat(8, 1fr);
  128. gap: 10px;
  129. }
  130. .wrap main .navs .user-top > * {
  131. background-color: blue;
  132. }
  133. .wrap main .navs .user-info {
  134. display: grid;
  135. grid-template-rows: 106px 60px 1fr 40px;
  136. gap: 10px;
  137. }
  138. .wrap main .navs .user-info > * {
  139. background-color: lightblue;
  140. }
  141. .wrap main .navs .user-info .logo {
  142. padding-top: 10px;
  143. display: grid;
  144. grid-template-rows: repeat(2, 1fr);
  145. /* place-content: center center; */
  146. place-items: center center;
  147. }
  148. .wrap main .navs .user-info .button {
  149. display: grid;
  150. grid-template-columns: repeat(3, 1fr);
  151. place-items: center center;
  152. }
  153. .wrap main .navs .user-info .user-shop {
  154. display: grid;
  155. grid-template-columns: repeat(4, 1fr);
  156. place-items: center center;
  157. gap: 10px;
  158. }
  159. /* 标题区 */
  160. .wrap main .title {
  161. background-color: #fff;
  162. display: flex;
  163. place-items: end;
  164. }
  165. .wrap main .title .tag {
  166. background: linear-gradient(to left, orangered, orange);
  167. color: #fff;
  168. padding: 0 5px;
  169. border-radius: 5px;
  170. margin-left: 5px;
  171. margin-bottom: 1px;
  172. }
  173. /* 商品列表 */
  174. .wrap main .list {
  175. margin: 20px 0;
  176. display: grid;
  177. grid-template-columns: repeat(3, 1fr);
  178. grid-auto-rows: 172px;
  179. gap: 10px;
  180. }
  181. .wrap main .list .item {
  182. background-color: rgb(244, 239, 239);
  183. border-radius: 6px;
  184. display: grid;
  185. grid-template-columns: 150px 1fr;
  186. padding: 10px;
  187. gap: 10px;
  188. }
  189. .wrap main .list .item > * {
  190. background-color: orange;
  191. }
  192. .wrap main .list .item img {
  193. width: 100%;
  194. border-radius: 6px;
  195. }
  196. .wrap main .list .item .detail {
  197. display: grid;
  198. grid-template-rows: 1fr 35px;
  199. }
  200. /* 媒体查询 */
  201. @media (max-width: 950px) {
  202. .wrap header .entry .content {
  203. grid-template-columns: 80px repeat(4, 1fr);
  204. }
  205. .wrap main .navs {
  206. grid-template-columns: 1fr;
  207. }
  208. .wrap main .navs .cate {
  209. display: none;
  210. }
  211. .wrap main .list {
  212. grid-template-columns: repeat(2, 1fr);
  213. }
  214. }

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