博客列表 >10.31日作业

10.31日作业

子墨吖ฅฅ
子墨吖ฅฅ原创
2022年11月01日 11:23:25340浏览
  1. *{
  2. margin: 0;
  3. padding: 0;
  4. }
  5. body{
  6. background-color: lightpink;
  7. min-height: 2000px;
  8. }
  9. /*清除列表默认样式*/
  10. li{
  11. list-style: none;
  12. }
  13. /*顶部导航样式*/
  14. header .nav-bg {
  15. background-color: #f4f4f4;
  16. height: 34px;
  17. display: grid;
  18. }
  19. header .nav-bg .nav{
  20. width: 1200px;
  21. margin: auto;
  22. display: grid;
  23. grid-template-columns: repeat(2,1fr);
  24. background-color: #f4f4f4;
  25. place-content: space-around;
  26. gap:180px;
  27. }
  28. header .nav-bg .nav .nav-left{
  29. display: flex;
  30. place-content: space-between;
  31. font-size: 14px;
  32. }
  33. header .nav-bg .nav .nav-right{
  34. display: flex;
  35. place-content: space-between;
  36. font-size: 14px;
  37. }
  38. /*快速入口样式*/
  39. header .nav-ksrk{
  40. width: 1200px;
  41. height: 100px;
  42. display: grid;
  43. grid-template-columns: 80px repeat(5,1fr);
  44. gap: 10px;
  45. margin:10px auto;
  46. }
  47. header .nav-ksrk .item{
  48. background-color: red;
  49. border-radius:10px;
  50. }
  51. /*主体部分样式*/
  52. main .search-nav{
  53. width: 1200px;
  54. height: 100px;
  55. display: grid;
  56. grid-template-columns: 1100px 100px;
  57. margin:auto;
  58. margin-top: 10px;
  59. background-color: #f4f4f4;
  60. }
  61. main .search-nav .erweima img{
  62. width: 75px;
  63. }
  64. main .search-nav section{
  65. display: grid;
  66. grid-template-columns:200px 900px;
  67. place-items: center;
  68. }
  69. main .search-nav section .search{
  70. width: 700px;
  71. height: 30px;
  72. border: 2px solid #f40;
  73. border-radius: 40px;
  74. display: grid;
  75. grid-template-columns: 50px 550px 100px;
  76. place-items: center;
  77. }
  78. main .search-nav section .search span:first-of-type{
  79. border-right: 1px solid;
  80. }
  81. main .search-nav section .search span:first-of-type + span{
  82. place-self: center start;
  83. color: #9b9b9b;
  84. }
  85. main .search-nav section .search span:last-of-type{
  86. place-self: center end ;
  87. font-size: 18px;
  88. font-weight: 700;
  89. cursor: pointer;
  90. border-radius: 30px;
  91. padding:3px 20px;
  92. color: #f4f4f4;
  93. background-color: #ff4400;
  94. }
  95. .navs section{
  96. width: 1200px;
  97. height: 450px;
  98. background-color: #f4f4f4;
  99. margin: auto;
  100. display: grid;
  101. grid-template-columns: 350px 850px;
  102. }
  103. .navs .navs-left div{
  104. width: 320px;
  105. height: 440px;
  106. background-color: #9b9b9b;
  107. border-radius: 10px;
  108. margin: auto;
  109. }
  110. .navs .navs-right{
  111. display: grid;
  112. grid-template-columns:540px 300px;
  113. grid-template-rows:50px 400px;
  114. }
  115. .navs .navs-right div:first-of-type{
  116. width: 800px;
  117. height: 40px;
  118. border-radius: 10px;
  119. grid-column: span 2;
  120. margin: auto;
  121. }
  122. .navs .navs-right div:first-of-type + div{
  123. width: 530px;
  124. height: 380px;
  125. border-radius: 10px;
  126. margin: auto;
  127. }
  128. .navs .navs-right div:last-of-type{
  129. width: 270px;
  130. height: 380px;
  131. border-radius: 10px;
  132. margin: auto;
  133. }
  134. main .title {
  135. width: 1200px;
  136. background-color: lightcyan;
  137. display: flex;
  138. place-items: center;
  139. margin: auto;
  140. }
  141. main .title .tag {
  142. background: linear-gradient(to left, orangered, orange);
  143. color: white;
  144. border-radius: 5px;
  145. padding: 0 5px;
  146. margin-left: 6px;
  147. cursor: default;
  148. }
  149. main .list {
  150. width: 1200px;
  151. margin: 0 auto;
  152. display: grid;
  153. grid-template-columns: repeat(3, 1fr);
  154. grid-auto-rows: 172px;
  155. gap: 10px;
  156. }
  157. main .list > .item {
  158. background-color: lightcyan;
  159. border-radius: 6px;
  160. display: grid;
  161. grid-template-columns: 150px 1fr;
  162. gap: 10px;
  163. padding: 10px;
  164. }
  165. main .list > .item > * {
  166. background-color: wheat;
  167. border-radius: 6px;
  168. }
  169. main .list > .item img {
  170. width: 100%;
  171. border-radius: 6px;
  172. }
  173. main .list .item .detail {
  174. display: grid;
  175. grid-template-rows: 1fr 25px;
  176. padding: 10px;
  177. place-content: space-between;
  178. }
  179. main .list .item .detail > * {
  180. background-color: aqua;
  181. }
  182. main .right{
  183. position: fixed;
  184. top: 40%;
  185. right:0;
  186. }
  187. main .right div{
  188. width: 50px;
  189. height: 300px;
  190. background-color:green;
  191. }
  192. footer{
  193. width: 1200px;
  194. height: 300px;
  195. background-color: red;
  196. margin: auto;
  197. }
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport"
  6. content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  7. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  8. <title>淘宝pc端布局</title>
  9. <link rel="stylesheet" href="index.css">
  10. </head>
  11. <body>
  12. <header>
  13. <div class="nav-bg">
  14. <div class="nav">
  15. <ul class="nav-left">
  16. <li>中国大陆</li>
  17. <li>亲,请登录</li>
  18. <li>免费注册</li>
  19. <li>手机逛淘宝</li>
  20. <li>网页无障碍</li>
  21. </ul>
  22. <ul class="nav-right">
  23. <li>我的淘宝</li>
  24. <li>购物车</li>
  25. <li>收藏夹</li>
  26. <li>商品分类</li>
  27. <li>免费开店</li>
  28. <li>千牛卖家中心</li>
  29. <li>联系客服</li>
  30. </ul>
  31. </div>
  32. </div>
  33. <!--快速入口-->
  34. <div class="nav-ksrk">
  35. <div class="item"></div>
  36. <div class="item"></div>
  37. <div class="item"></div>
  38. <div class="item"></div>
  39. <div class="item"></div>
  40. <div class="item"></div>
  41. </div>
  42. </header>
  43. <!--主体部分-->
  44. <main>
  45. <!--搜索框-->
  46. <div class="search-nav">
  47. <section>
  48. <div class="logo">
  49. <img src="https://gw.alicdn.com/imgextra/i3/O1CN01uRz3de23mzWofmPYX_!!6000000007299-2-tps-143-59.png" alt="">
  50. </div>
  51. <div class="item">
  52. <div class="search">
  53. <span>宝贝</span>
  54. <span>输入搜索内容</span>
  55. <span>搜索</span>
  56. </div>
  57. </div>
  58. </section>
  59. <div class="erweima">
  60. <span>下载淘宝</span>
  61. <img src="//gw.alicdn.com/imgextra/i4/O1CN01GZ8Gm51DHyo7asI5m_!!6000000000192-2-tps-160-160.png" alt="">
  62. </div>
  63. </div>
  64. <div class="navs">
  65. <section>
  66. <div class="navs-left">
  67. <div>分类</div>
  68. </div>
  69. <div class="navs-right">
  70. <div style="background-color: green">顶部导航</div>
  71. <div style="background-color: red">轮播图</div>
  72. <div style="background-color: yellow">用户管理</div>
  73. </div>
  74. </section>
  75. </div>
  76. <div class="title">
  77. <h2>猜你喜欢</h2>
  78. <div class="tag">个性推荐</div>
  79. </div>
  80. <div class="list">
  81. <div class="item">
  82. <a href=""><img src="" alt="" /></a>
  83. <div class="detail">
  84. <div class="desc">商品描述商品描述商品描述商品描述</div>
  85. <div class="price">159</div>
  86. </div>
  87. </div>
  88. <div class="item">
  89. <a href=""><img src="" alt="" /></a>
  90. <div class="detail">
  91. <div class="desc">商品描述商品描述商品描述商品描述</div>
  92. <div class="price">159</div>
  93. </div>
  94. </div>
  95. <div class="item">
  96. <a href=""><img src="" alt="" /></a>
  97. <div class="detail">
  98. <div class="desc">商品描述商品描述商品描述商品描述</div>
  99. <div class="price">159</div>
  100. </div>
  101. </div>
  102. </div>
  103. <div class="right">
  104. <div>固定导航</div>
  105. </div>
  106. </main>
  107. <!--底部-->
  108. <footer>
  109. 底部
  110. </footer>
  111. </body>
  112. </html>

运行效果图

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