0


css+html制作订单页面

这是我完成的第一个小项目,根着b站黑马前端进阶课程做的。话不多说,先上效果图:

目前只用到html+css,其实都是一些基础操作,主要是熟悉flex布局。

html部分

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>确认订单</title>
  8. <link rel="stylesheet" href="./lib/iconfont/iconfont.css">
  9. <link rel="stylesheet" href="/xiaotuxian/css/practice.css">
  10. <link rel="stylesheet" href="/xiaotuxian/css/base.css">
  11. </head>
  12. <body>
  13. <!--主体内容-->
  14. <div class="main">
  15. <!--用户信息-->
  16. <div class="pannel user_msg">
  17. <div class="location">
  18. <i class="iconfont icon-location"></i>
  19. </div>
  20. <div class="user">
  21. <div class="top"><h6>高哈哈</h6>
  22. <p>18778846715</p>
  23. </div>
  24. <div class="bottom">云南省曲靖市海淀区</div>
  25. </div>
  26. <div class="more">
  27. <i class="iconfont icon-more"></i>
  28. </div>
  29. </div>
  30. </div>
  31. <!--商品信息-->
  32. <div class="pannel goods">
  33. <div class="pic">
  34. <a href="#"><img src="/xiaotuxian/uploads/pic.png" alt=""> </a>
  35. </div>
  36. <div class="info">
  37. <h5>康贝尔 非接触试红外体温仪
  38. 领劵立减300元 婴儿级材质 测温...</h5>
  39. <p><span>粉色</span> <span>红外体温仪</span> </p>
  40. <div class="price">
  41. <span class="red"><i>999</i></span>
  42. <span>¥1299</span>
  43. </div>
  44. </div>
  45. <div class="count">
  46. <i class="iconfont icon-x"></i>
  47. <span>1</span>
  48. </div>
  49. </div>
  50. <!--配送方式-->
  51. <section class="pannel rest">
  52. <div>
  53. <h5>配送方式</h5>
  54. <p>顺丰快递</p>
  55. </div>
  56. <div>
  57. <h5>买家备注</h5>
  58. <p>希望卖家可以快点发货~谢谢!!</p>
  59. </div>
  60. <div>
  61. <h5>支付方式</h5>
  62. <p>支付宝</p>
  63. </div>
  64. </section>
  65. <!--商品总价-->
  66. <section class="pannel rest2">
  67. <div>
  68. <h5>商品总价</h5>
  69. <p>¥999.00</p>
  70. </div>
  71. <div>
  72. <h5>运费</h5>
  73. <p>¥0.00</p>
  74. </div>
  75. <div>
  76. <h5>折扣</h5>
  77. <p>¥300.00</p>
  78. </div>
  79. </section>
  80. <!--底部支付-->
  81. <div class="pay">
  82. <div class="left">
  83. 合计:<span class="red"><i>999.00
  84. </i></span>
  85. </div>
  86. <div class="right">
  87. <a href="#">已支付</a>
  88. </div>
  89. </div>
  90. </body>
  91. </html>

css样式设计

  1. /*公共样式*/
  2. body{
  3. background-color: #f7f7f8;
  4. }
  5. .red{
  6. color: red;
  7. }
  8. .pannel{
  9. margin-bottom: 10px;
  10. background-color: #fff;
  11. border-radius: 5px;
  12. }
  13. /*主体内容*/
  14. .main{
  15. padding: 12px 11px 5px;/*上 左右 下*/
  16. }
  17. .user_msg{
  18. display: flex;
  19. align-items: center;
  20. padding: 15px 0 15px 11px;
  21. }
  22. .user_msg .location{
  23. width: 30px;
  24. height: 30px;
  25. margin-right: 10px;
  26. background-image: linear-gradient(90deg,
  27. #6fc2aa 5%,#54b196 100%);
  28. border-radius: 50%;
  29. text-align: center;
  30. line-height: 30px;
  31. color: #fff;
  32. }
  33. .user_msg .user{
  34. flex:1;
  35. }
  36. .user_msg .user .top{
  37. display: flex;
  38. }
  39. .user_msg .user .top h6{
  40. width: 55px;
  41. font-size: 15px;
  42. font-weight: 400;
  43. }
  44. .user_msg .user .top p{
  45. font-size: 13px;
  46. }
  47. .user_msg .user .bottom{
  48. margin-top: 5px;
  49. font-size: 12px;
  50. }
  51. .user_msg .more{
  52. width: 44px;
  53. height: 44px;
  54. /* background-color:#54b196; */
  55. text-align: center;
  56. line-height: 44px;
  57. color: #808080;
  58. }
  59. /*底部左支付*/
  60. .pay{
  61. position: fixed;
  62. left: 0;
  63. bottom: 0;
  64. display: flex;
  65. justify-content: space-between;
  66. align-items: center;
  67. width: 100%;
  68. height: 80px;
  69. padding: 0 11px;
  70. /* background-color: white; */
  71. border-top: 1px solid #ededed;
  72. }
  73. .pay .left{
  74. font-size: 12px ;
  75. }
  76. .pay .left i{
  77. font-style: normal;
  78. font-size: 20px;
  79. }
  80. .pay .right a{
  81. display: block;
  82. width: 90px;
  83. height: 35px;
  84. background-image: linear-gradient(90deg,
  85. #6fc2aa 5%,
  86. #54b196 100%);
  87. border-radius: 3px ;
  88. text-align: center;
  89. line-height: 35px;
  90. font-size: 13px;
  91. color: #fff;
  92. }
  93. /*goods*/
  94. .goods{
  95. display: flex;
  96. padding: 11px 0 11px 11px;
  97. }
  98. .goods .pic{
  99. width: 85px;
  100. height: 85px;
  101. margin-right: 10px;
  102. }
  103. .goods .info{
  104. flex: 1;
  105. }
  106. .goods .info h5{
  107. font-size: 13px;
  108. color: #262626;
  109. font-weight: 400;
  110. }
  111. .goods .info p{
  112. width: 95px;
  113. height: 20px;
  114. margin: 5px 0;
  115. background-color: #f7f7f8;
  116. font-size: 12px;
  117. color: #888;
  118. }
  119. .goods .info span:first-child{
  120. margin-right: 5px;
  121. }
  122. .goods .info .price{
  123. font-size: 12px;
  124. }
  125. .goods .info .price i{
  126. font-size: 16px;
  127. }
  128. .goods .info .price span:last-child{
  129. margin-left: 5px;
  130. color: #999;
  131. text-decoration: line-through;
  132. }
  133. .goods .count{
  134. width: 44px;
  135. height: 44px;
  136. text-align: center;
  137. line-height: 44px;
  138. }
  139. .rest{
  140. padding: 15px ;
  141. }
  142. .rest div{
  143. display: flex;
  144. margin-bottom: 30px;
  145. }
  146. .rest div:last-child{
  147. margin-bottom: 0;
  148. }
  149. .rest div:nth-child(2n+1){
  150. justify-content: space-between;
  151. }
  152. .rest div:nth-child(2) p{
  153. margin-left: 20px;
  154. font-size: 12px;
  155. color: #989898;
  156. }
  157. .rest h5 ,.rest p{
  158. font-size: 12px;
  159. color: #262626;
  160. font-weight: 400;
  161. }
  162. .rest2{
  163. padding: 15px ;
  164. }
  165. .rest2 div{
  166. display: flex;
  167. margin-bottom: 30px;
  168. }
  169. .rest2 div{
  170. justify-content: space-between;
  171. font-size: 12px;
  172. }
  173. .rest2 h5 ,.rest p{
  174. font-size: 12px;
  175. color: #262626;
  176. font-weight: 400;
  177. }
标签: 前端 css3 html5

本文转载自: https://blog.csdn.net/qq_64595930/article/details/128500612
版权归原作者 Ο好呵 所有, 如有侵权,请联系我们删除。

“css+html制作订单页面”的评论:

还没有评论