博客列表 >0101-购物车结算页面

0101-购物车结算页面


原创
2020年01月05日 23:11:201489浏览

购物车页面

HTML

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <link rel="stylesheet" href="shopcar.css">
  6. <title>购物车</title>
  7. </head>
  8. <body>
  9. <!-- 头部 -->
  10. <nav class="public-header">
  11. <a href="">网站首页</a>
  12. <a href="">专题</a>
  13. <a href="">网站导航</a>
  14. <a href="">二手商品</a>
  15. <a href="">讨论区</a>
  16. <span>
  17. <a href=""><i class="iconfont icon-huiyuan2"></i>登陆</a>
  18. <a href="">免费注册</a>
  19. </span>
  20. </nav>
  21. <!--商城购物车-->
  22. <div class="shop-shopping-cart">
  23. <div class="public-headline">
  24. <span>购物车</span>
  25. </div>
  26. <!--购物车头部-->
  27. <header>
  28. <!--flex-->
  29. <span>
  30. <input type="checkbox" id="all-selected" checked>
  31. <label for="all-selected">全选</label>
  32. </span>
  33. <span>商品</span>
  34. <span>单价</span>
  35. <span>数量</span>
  36. <span>小计</span>
  37. <span>操作</span>
  38. </header>
  39. <!--购物车主体-->
  40. <main>
  41. <div>
  42. <span>
  43. <label><input type="checkbox" name="choose" checked></label>
  44. </span>
  45. <!--图文介绍-->
  46. <span class="pic-intro">
  47. <a href=""><img src="../../../static/images/11.jpg" alt=""></a>
  48. <a href="">一个商品介绍</a>
  49. </span>
  50. <span>998.00</span>
  51. <span>
  52. <label><input type="number" name="count" value="1" min="1"></label>
  53. </span>
  54. <span><i>&yen;</i>998.00</span>
  55. <span><a href="">删除</a></span>
  56. </div>
  57. <div>
  58. <span>
  59. <label><input type="checkbox" name="choose" checked></label>
  60. </span>
  61. <!--图文介绍-->
  62. <span class="pic-intro">
  63. <a href=""><img src="../../../static/images/11.jpg" alt=""></a>
  64. <a href="">一个商品介绍</a>
  65. </span>
  66. <span>998.00</span>
  67. <span>
  68. <label><input type="number" name="count" value="1" min="1"></label>
  69. </span>
  70. <span><i>&yen;</i>998.00</span>
  71. <span><a href="">删除</a></span>
  72. </div>
  73. </main>
  74. <!--购物车底部-->
  75. <div>
  76. <span>数量: <i>2</i></span>
  77. <span>金额: <i>1996.00</i></span>
  78. <button>结算</button>
  79. </div>
  80. <!-- 脚部 -->
  81. <footer class="public-footer">
  82. <div>
  83. <a href="">简介</a>
  84. <a href="">联系我们</a>
  85. <a href="">招聘信息</a>
  86. <a href="">友情链接</a>
  87. <a href="">用户服务协议</a>
  88. <a href="">隐私权声明</a>
  89. <a href="">法律投诉声明</a>
  90. </div>
  91. <div><span>LOGO</span></div>
  92. <div>
  93. <p>2019 fengniao.com. All rights reserved . 安徽闹着玩有限公司(无聊网)版权所有</p>
  94. <p>皖ICP证150110号 京ICP备14323013号-2 皖公网安备110108024357788号</p>
  95. <p>违法和不良信息举报电话: 0551-1234567 举报邮箱: admin@baidu.com</p>
  96. </div>
  97. <div>
  98. <p>关注公众号</p>
  99. <img src="../../../static/images/erwei-code.png" alt="">
  100. </div>
  101. </footer>
  102. </body>
  103. </html>

CSS

  1. @import "../public-reset.css";
  2. @import "../../shop/shopcar/public_header/public_header.css";
  3. @import "../../shop/shopcar/public_headline/public_headline.css";
  4. @import "../../shop/shopcar/public_footer/public_footer.css";
  5. .shop-shopping-cart {
  6. width: 1200px;
  7. background-color: #fff;
  8. margin: 30px auto;
  9. padding: 15px 0;
  10. border-radius: 8px;
  11. box-sizing: border-box;
  12. }
  13. .shop-shopping-cart:hover {
  14. box-shadow: 0 0 8px #888888;
  15. }
  16. /*标题*/
  17. .shop-shopping-cart > .public-headline > span {
  18. font-size: 20px;
  19. text-align: center;
  20. font-weight: normal;
  21. margin-bottom: 20px;
  22. margin: auto;
  23. }
  24. /*购物车头部*/
  25. .shop-shopping-cart > header {
  26. height: 40px;
  27. border-bottom: 1px solid #cccccc;
  28. /*flex*/
  29. display: flex;
  30. justify-content: space-around;
  31. align-items: center;
  32. }
  33. /*购物车主体*/
  34. .shop-shopping-cart > main {
  35. margin: 20px 0;
  36. }
  37. /*购物车中的每一条记录, 每一个商品*/
  38. .shop-shopping-cart > main > div {
  39. height: 80px;
  40. /*flex*/
  41. display: flex;
  42. justify-content: space-around;
  43. align-items: center;
  44. }
  45. .shop-shopping-cart > main > div:hover {
  46. background-color: lightcyan;
  47. }
  48. .shop-shopping-cart > main > div .pic-intro {
  49. width: 250px;
  50. display: flex;
  51. align-items: center;
  52. }
  53. .shop-shopping-cart > main > div .pic-intro img {
  54. width: 60px;
  55. height: 45px;
  56. margin-right: 10px;
  57. }
  58. .shop-shopping-cart > main > div a:hover {
  59. color: lightcoral;
  60. }
  61. /*微调第一个复选框*/
  62. .shop-shopping-cart > main > div > span:first-of-type {
  63. position: relative;
  64. left: 25px;
  65. }
  66. .shop-shopping-cart > main > div > span.pic-intro {
  67. position: relative;
  68. left: -40px;
  69. }
  70. .shop-shopping-cart > main > div > span:nth-of-type(3) {
  71. position: relative;
  72. left: -80px;
  73. }
  74. .shop-shopping-cart > main > div > span:nth-of-type(4) {
  75. position: relative;
  76. left: -60px;
  77. }
  78. .shop-shopping-cart > main > div > span:nth-of-type(4) input {
  79. width: 60px;
  80. }
  81. .shop-shopping-cart > main > div > span:nth-last-of-type(2) {
  82. position: relative;
  83. left: -50px;
  84. }
  85. .shop-shopping-cart > main > div > span:last-of-type {
  86. position: relative;
  87. left: -50px;
  88. }
  89. .shop-shopping-cart > main > div > span:nth-last-of-type(2) i {
  90. color: green;
  91. font-size: 1.01rem;
  92. margin-right: 3px;
  93. }
  94. /*购物车底部*/
  95. .shop-shopping-cart > div {
  96. height: 70px;
  97. padding: 20px;
  98. border-top: 1px solid #cccccc;
  99. box-sizing: border-box;
  100. display: flex;
  101. justify-content: flex-end;
  102. align-items: center;
  103. }
  104. .shop-shopping-cart > div > *:not(:last-child) {
  105. width: 180px;
  106. }
  107. .shop-shopping-cart > div > button {
  108. height: 40px;
  109. width: 120px;
  110. background-color: lightcoral;
  111. border: none;
  112. color: white;
  113. font-size: 1.1rem;
  114. }
  115. .shop-shopping-cart > div > button:hover {
  116. background-color: seagreen;
  117. cursor: pointer;
  118. }

效果图

结算页面

HTML

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <link rel="stylesheet" href="shopjiesuan.css">
  6. <title>购物车结算</title>
  7. </head>
  8. <body>
  9. <!-- 头部 -->
  10. <nav class="public-header">
  11. <a href="">网站首页</a>
  12. <a href="">专题</a>
  13. <a href="">网站导航</a>
  14. <a href="">二手商品</a>
  15. <a href="">讨论区</a>
  16. <span>
  17. <a href=""><i class="iconfont icon-huiyuan2"></i>登陆</a>
  18. <a href="">免费注册</a>
  19. </span>
  20. </nav>
  21. <!--商城购物车-->
  22. <div class="shop-shopping-cart">
  23. <div class="public-headline">
  24. <span>购物车结算</span>
  25. </div>
  26. <!-- 收货地址 -->
  27. <div class="address-list">
  28. <div class="title">
  29. <h4>确认收货地址</h4>
  30. </div>
  31. <div class="list-item active">
  32. <span>寄送至</span>
  33. <div>
  34. <input type="radio" name="address" id="address_1" checked>
  35. <label for="address_1">XX省 XX市 XX区 XX街道 XX收</label>
  36. </div>
  37. <a href="#">修改本地址</a>
  38. </div>
  39. <div class="list-item">
  40. <span></span>
  41. <div>
  42. <input type="radio" name="address" id="address_2">
  43. <label for="address_2">XX省 XX市 XX区 XX街道 XX收</label>
  44. </div>
  45. </div>
  46. </div>
  47. <!--购物车头部-->
  48. <header>
  49. <!--flex-->
  50. <span>
  51. <input type="checkbox" id="all-selected" checked>
  52. <label for="all-selected">全选</label>
  53. </span>
  54. <span>商品</span>
  55. <span>单价</span>
  56. <span>数量</span>
  57. <span>小计</span>
  58. <span>操作</span>
  59. </header>
  60. <!--购物车主体-->
  61. <main>
  62. <div>
  63. <span>
  64. <label><input type="checkbox" name="choose" checked></label>
  65. </span>
  66. <!--图文介绍-->
  67. <span class="pic-intro">
  68. <a href=""><img src="../../../static/images/11.jpg" alt=""></a>
  69. <a href="">一个商品介绍</a>
  70. </span>
  71. <span>998.00</span>
  72. <span>
  73. <label><input type="number" name="count" value="1" min="1"></label>
  74. </span>
  75. <span><i>&yen;</i>998.00</span>
  76. <span><a href="">删除</a></span>
  77. </div>
  78. <div>
  79. <span>
  80. <label><input type="checkbox" name="choose" checked></label>
  81. </span>
  82. <!--图文介绍-->
  83. <span class="pic-intro">
  84. <a href=""><img src="../../../static/images/11.jpg" alt=""></a>
  85. <a href="">一个商品介绍</a>
  86. </span>
  87. <span>998.00</span>
  88. <span>
  89. <label><input type="number" name="count" value="1" min="1"></label>
  90. </span>
  91. <span><i>&yen;</i>998.00</span>
  92. <span><a href="">删除</a></span>
  93. </div>
  94. </main>
  95. <div class="pay-info">
  96. <div>
  97. <span>
  98. <span>实付款:</span>
  99. <span class="price"><i>&yen;</i>1996.00</span>
  100. </span>
  101. <span><span>寄送至:</span>XX省 XX市 XX区 XX街道</span>
  102. <span><span>收货人:</span>XX 18888888888</span>
  103. </div>
  104. <div>
  105. <a href="#"><i class="iconfont icon-shangyibu"></i>返回购物车</a>
  106. <button>提交订单</button>
  107. </div>
  108. </div>
  109. <!-- 脚部 -->
  110. <footer class="public-footer">
  111. <div>
  112. <a href="">简介</a>
  113. <a href="">联系我们</a>
  114. <a href="">招聘信息</a>
  115. <a href="">友情链接</a>
  116. <a href="">用户服务协议</a>
  117. <a href="">隐私权声明</a>
  118. <a href="">法律投诉声明</a>
  119. </div>
  120. <div><span>LOGO</span></div>
  121. <div>
  122. <p>2019 fengniao.com. All rights reserved . 安徽闹着玩有限公司(无聊网)版权所有</p>
  123. <p>皖ICP证150110号 京ICP备14323013号-2 皖公网安备110108024357788号</p>
  124. <p>违法和不良信息举报电话: 0551-1234567 举报邮箱: admin@baidu.com</p>
  125. </div>
  126. <div>
  127. <p>关注公众号</p>
  128. <img src="../../../static/images/erwei-code.png" alt="">
  129. </div>
  130. </footer>
  131. </div>
  132. </body>
  133. </html>

CSS

  1. @import "../public-reset.css";
  2. @import "../../shop/shopcar/public_header/public_header.css";
  3. @import "../../shop/shopcar/public_headline/public_headline.css";
  4. @import "../../shop/shopcar/public_footer/public_footer.css";
  5. .shop-shopping-cart {
  6. width: 1200px;
  7. background-color: #fff;
  8. margin: 30px auto;
  9. padding: 15px 0;
  10. border-radius: 8px;
  11. box-sizing: border-box;
  12. }
  13. .shop-shopping-cart:hover {
  14. box-shadow: 0 0 8px #888888;
  15. }
  16. /*标题*/
  17. .shop-shopping-cart > .public-headline > span {
  18. font-size: 20px;
  19. text-align: center;
  20. font-weight: normal;
  21. margin-bottom: 20px;
  22. margin: auto;
  23. }
  24. /*收货地址*/
  25. .shop-shopping-cart > .address-list{
  26. display: flex;
  27. flex-flow: column wrap;
  28. }
  29. .shop-shopping-cart > .address-list > .list-item{
  30. margin-top: 10px;
  31. width: 500px;
  32. height: 30px;
  33. padding: 0 20px;
  34. box-sizing: border-box;
  35. display: grid;
  36. grid-template-columns: 80px 1fr 80px;
  37. font-size: 13px;
  38. line-height: 30px;
  39. }
  40. .shop-shopping-cart > .address-list > .list-item:hover{
  41. background-color: #fff0e8;
  42. cursor: pointer;
  43. }
  44. .active{
  45. border:1px solid lightcoral;
  46. background-color: #fff0e8;
  47. box-shadow: 5px 5px 0 #f3f3f3;
  48. font-weight: bold;
  49. }
  50. .active > span:first-child{
  51. color:lightcoral;
  52. }
  53. /*购物车头部*/
  54. .shop-shopping-cart > header {
  55. height: 40px;
  56. border-bottom: 1px solid #cccccc;
  57. /*flex*/
  58. display: flex;
  59. justify-content: space-around;
  60. align-items: center;
  61. }
  62. /*购物车主体*/
  63. .shop-shopping-cart > main {
  64. margin: 20px 0;
  65. }
  66. /*购物车中的每一条记录, 每一个商品*/
  67. .shop-shopping-cart > main > div {
  68. height: 80px;
  69. /*flex*/
  70. display: flex;
  71. justify-content: space-around;
  72. align-items: center;
  73. }
  74. .shop-shopping-cart > main > div:hover {
  75. background-color: lightcyan;
  76. }
  77. .shop-shopping-cart > main > div .pic-intro {
  78. width: 250px;
  79. display: flex;
  80. align-items: center;
  81. }
  82. .shop-shopping-cart > main > div .pic-intro img {
  83. width: 60px;
  84. height: 45px;
  85. margin-right: 10px;
  86. }
  87. .shop-shopping-cart > main > div a:hover {
  88. color: lightcoral;
  89. }
  90. /*微调第一个复选框*/
  91. .shop-shopping-cart > main > div > span:first-of-type {
  92. position: relative;
  93. left: 25px;
  94. }
  95. .shop-shopping-cart > main > div > span.pic-intro {
  96. position: relative;
  97. left: -40px;
  98. }
  99. .shop-shopping-cart > main > div > span:nth-of-type(3) {
  100. position: relative;
  101. left: -80px;
  102. }
  103. .shop-shopping-cart > main > div > span:nth-of-type(4) {
  104. position: relative;
  105. left: -60px;
  106. }
  107. .shop-shopping-cart > main > div > span:nth-of-type(4) input {
  108. width: 60px;
  109. }
  110. .shop-shopping-cart > main > div > span:nth-last-of-type(2) {
  111. position: relative;
  112. left: -50px;
  113. }
  114. .shop-shopping-cart > main > div > span:last-of-type {
  115. position: relative;
  116. left: -50px;
  117. }
  118. .shop-shopping-cart > main > div > span:nth-last-of-type(2) i {
  119. color: green;
  120. font-size: 1.01rem;
  121. margin-right: 3px;
  122. }
  123. /*购物车底部*/
  124. .shop-shopping-cart > div {
  125. height: 70px;
  126. padding: 20px;
  127. border-top: 1px solid #cccccc;
  128. box-sizing: border-box;
  129. display: flex;
  130. justify-content: flex-end;
  131. align-items: center;
  132. }
  133. .shop-shopping-cart > div > *:not(:last-child) {
  134. width: 180px;
  135. }
  136. .shop-shopping-cart > div > button {
  137. height: 40px;
  138. width: 120px;
  139. background-color: lightcoral;
  140. border: none;
  141. color: white;
  142. font-size: 1.1rem;
  143. }
  144. .shop-shopping-cart > div > button:hover {
  145. background-color: seagreen;
  146. cursor: pointer;
  147. }
  148. .shop-shopping-cart > .pay-info{
  149. width: 1200px;
  150. height: 200px;
  151. display: flex;
  152. margin-top: 20px;
  153. flex-direction: column;
  154. justify-content: flex-end;
  155. }
  156. .shop-shopping-cart > .pay-info > div{
  157. margin-left: auto;
  158. width:300px;
  159. font-size: 13px;
  160. }
  161. .shop-shopping-cart > .pay-info > div:first-child{
  162. border: 1px solid lightcoral;
  163. text-align: right;
  164. display: grid;
  165. line-height: 30px;
  166. padding:10px;
  167. }
  168. .shop-shopping-cart > .pay-info > div:first-child > span > span{
  169. font-weight: bold;
  170. }
  171. .shop-shopping-cart > .pay-info > div:first-child > span:first-child > span:last-child{
  172. font-size: 25px;
  173. }
  174. .shop-shopping-cart > .pay-info > div:last-child{
  175. width:320px;
  176. display: grid;
  177. grid-template-rows: 30px;
  178. grid-template-columns: 1fr 1fr;
  179. }
  180. .shop-shopping-cart > .pay-info > div:last-child > a{
  181. justify-self: center;
  182. align-self: center;
  183. }
  184. .shop-shopping-cart > .pay-info > div:last-child > button{
  185. border: none;
  186. background-color: lightcoral;
  187. color: #fff;
  188. }

效果图

两页面主体部分内容相似代码共用

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