Correcting teacher:天蓬老师
Correction status:qualified
Teacher's comments:完成的很出色, 写了半天吧
仿写淘宝购物车页面的主体部分,页头和页脚用之前做的组件进行拼装
仿写对象:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<link rel="stylesheet" href="shop_shopingcart.css">
<link rel="stylesheet" href="../../static/font/iconfont.css">
</head>
<body>
<!--引入公共头部组件-->
<div class="public-header">
<a href="">网站首页</a>
<a href="">专题</a>
<a href="">网站导航</a>
<a href="">二手商品</a>
<a href="">讨论区</a>
<span>
<a href=""><i class="iconfont icon-huiyuan2"></i>登陆</a>
<a href="">免费注册</a>
</span>
</div>
<!--仿写的淘宝购物车页面主体部分-->
<div class="shop-shopingcart">
<!--信息统计-->
<div class="title">
<ul>
<li>
<a href="">
<span>全部商品</span>
<span>4</span>
</a>
</li>
<li>
<a href="">
<span>降价商品</span>
<span>0</span>
</a>
</li>
<li>
<a href="">
<span>库存紧张</span>
<span>0</span>
</a>
</li>
</ul>
<div>
<span>已选商品(不含运费)</span>
<span>¥283.80</span>
<button>结算</button>
</div>
</div>
<!--商品清单表头-->
<div class="thead">
<!--复选框及全选标签-->
<input type="checkbox" name="all" id="alltop" >
<label for="alltop">全选</label>
<span>商品信息</span>
<span>单位</span>
<span>数量</span>
<span>金额</span>
<span>操作</span>
</div>
<!--购物车清单主体-->
<div class="cartinfo">
<!--单个店铺区-->
<div class="goodsinfo">
<!--店铺名称区-->
<div class="shop">
<input type="checkbox" name="shopname" id="shopname" value="百瑞源旗舰店" checked>
<img src="../../static/images/shopingcart/tianmao.jpg" alt=""><!--天猫图标 -->
<span>店铺:</span>
<a href="">百瑞源旗舰店</a>
<img src="../../static/images/shopingcart/wangwang.jpg" alt=""><!--旺旺图标 -->
</div>
<!--商品信息区-->
<div class="goods">
<input type="checkbox" name="price" id="price" value="255.8" checked><!--商品复选框-->
<!--商品图片 -->
<a href="">
<img src="../../static/images/shopingcart/gouqi.jpg" alt="">
</a>
<!--商品具体信息及下方信用图标-->
<div>
<a>百瑞源-顶天红枸杞子宁夏正宗特级优枸杞干免洗中宁枸杞泡茶男肾</a>
<!--商品资质图片-->
<div class="img">
<img src="../../static/images/shopingcart/xcard.png" alt=""><!-- 信用-->
<a href=""><img src="../../static/images/shopingcart/qitian.png" alt=""></a><!-- 七天-->
<a href=""><img src="../../static/images/shopingcart/baozhang.png" alt=""></a><!-- 保障-->
</div>
</div>
<!--单价-->
<span>¥127.90</span>
<!--数量输入框-->
<input type="number" value="2" step="1">
<!--总价-->
<span>¥255.80</span>
<!--删除 -->
<a>删除</a>
</div>
</div>
<div class="goodsinfo">
<!--店铺名称区-->
<div class="shop">
<input type="checkbox" name="shopname" id="shopname" value="小熊慕熙专卖店">
<img src="../../static/images/shopingcart/tianmao.jpg" alt=""><!--天猫图标 -->
<span>店铺:</span>
<a href="">小熊慕熙专卖店</a>
<img src="../../static/images/shopingcart/wangwang.jpg" alt=""><!--旺旺图标 -->
</div>
<!--商品信息区-->
<div class="goods">
<input type="checkbox" name="price" id="price" value="127.9" ><!--商品复选框-->
<!--商品图片 -->
<a href="">
<img src="../../static/images/shopingcart/guo.jpg" alt="">
</a>
<!--商品具体信息及下方信用图标-->
<div>
<a>小熊电煮锅多功能宿舍神器学生锅家用迷你小电锅炒炖蒸煮面一体锅</a>
<!--商品资质图片-->
<div class="img">
<img src="../../static/images/shopingcart/xcard.png" alt=""><!-- 信用-->
<a href=""><img src="../../static/images/shopingcart/qitian.png" alt=""></a><!-- 七天-->
<a href=""><img src="../../static/images/shopingcart/baozhang.png" alt=""></a><!-- 保障-->
</div>
</div>
<!--单价-->
<span>¥127.90</span>
<!--数量输入框-->
<input type="number" value="1" step="1">
<!--总价-->
<span>¥127.90</span>
<!--删除 -->
<a>删除</a>
</div>
</div>
<div class="goodsinfo">
<!--店铺名称区-->
<div class="shop">
<input type="checkbox" name="shopname" id="shopname" value="maling梅林旗舰店" checked>
<img src="../../static/images/shopingcart/tianmao.jpg" alt=""><!--天猫图标 -->
<span>店铺:</span>
<a href="">maling梅林旗舰店</a>
<img src="../../static/images/shopingcart/wangwang.jpg" alt=""><!--旺旺图标 -->
</div>
<!--商品信息区-->
<div class="goods">
<input type="checkbox" name="price" id="price" value="13.9" checked ><!--商品复选框-->
<!--商品图片 -->
<a href="">
<img src="../../static/images/shopingcart/guantou1.jpg" alt="">
</a>
<!--商品具体信息及下方信用图标-->
<div>
<a>梅林糖水荔枝罐头650g 果肉饱满夏季休闲水果沙拉饮料蛋糕甜点</a>
<!--商品资质图片-->
<div class="img">
<img src="../../static/images/shopingcart/xcard.png" alt=""><!-- 信用-->
<a href=""><img src="../../static/images/shopingcart/qitian.png" alt=""></a><!-- 七天-->
<a href=""><img src="../../static/images/shopingcart/baozhang.png" alt=""></a><!-- 保障-->
</div>
</div>
<!--单价-->
<span>¥13.90</span>
<!--数量输入框-->
<input type="number" value="1" step="1">
<!--总价-->
<span>¥13.90</span>
<!--删除 -->
<a>删除</a>
</div>
<div class="goods">
<input type="checkbox" name="price" id="price" value="13.9" checked ><!--商品复选框-->
<!--商品图片 -->
<a href="">
<img src="../../static/images/shopingcart/guantou2.jpg" alt="">
</a>
<!--商品具体信息及下方信用图标-->
<div>
<a>上海梅林糖水黄桃水果罐头650g新鲜水果沙拉蛋糕甜点烘焙食品材料</a>
<!--商品资质图片-->
<div class="img">
<img src="../../static/images/shopingcart/xcard.png" alt=""><!-- 信用-->
<a href=""><img src="../../static/images/shopingcart/qitian.png" alt=""></a><!-- 七天-->
<a href=""><img src="../../static/images/shopingcart/baozhang.png" alt=""></a><!-- 保障-->
</div>
</div>
<!--单价-->
<span>¥13.90</span>
<!--数量输入框-->
<input type="number" value="1" step="1">
<!--总价-->
<span>¥13.90</span>
<!--删除 -->
<a>删除</a>
</div>
</div>
</div>
<!--购物车清单底部-->
<div class="cartfooter">
<!--底部前段商品选择区-->
<ul>
<li>
<input type="checkbox" name="all" id="allbottom">
</li>
<li><label for="allbottom">全选</label></li>
<li><a href="">删除</a></li>
<li><a href="">移入收藏夹</a></li>
<li><a href="">分享</a></li>
</ul>
<!--底部后端结算信息-->
<ul>
<li>
<a href="">已选商品<span>3</span>件</a>
</li>
<li>合计(不含运费):</li>
<li>¥283.60</li>
</ul>
<button>结算</button>
</div>
</div>
<!--引入公共页脚组件-->
<div class="public-footer">
<ul>
<li><a href="">简介</a></li>
<li><a href="">联系我们</a></li>
<li><a href="">招聘信息</a></li>
<li><a href="">友情链接</a></li>
<li><a href="">用户服务协议</a></li>
<li><a href="">隐私权声明</a></li>
<li><a href="">法律投诉声明</a></li>
</ul>
<span>LOGO</span>
<div>
<p>2019 fengniao.com. All rights reserved.安徽闹着玩有限公司(无聊网)版权所有</p>
<p>皖ICP证15110号 京ICP备14323013号-2 皖公网安备110108024357788号</p>
<p>违法和不良信息举报电话:0551-1234567 举报邮箱:admin@baidu.com</p>
</div>
<div>
<span>关注公众号</span>
<img src="../../static/images/erwei-code.png" alt="">
</div>
</div>
</body>
</html>
header
@import "../reset.css";
.public-header {
width: 100%;
height: 44px;
padding: 0 20px;
box-sizing: border-box;
background-color: black;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
}
.public-header a {
color: white;
padding: 0 10px;
line-height: 44px;
font-size: 13px;
}
.public-header > a:hover {
background-color: white;
color: black;
}
.public-header span {
margin-left: auto;
}
.public-header i {
margin-right: 10px;
font-size: 13px;
}
main(shop-shopingcart)
@import "../../public/reset.css";
@import "../../public/public_header/public_header.css";
@import "../../public/public_footer/public_footer.css";
body {
background-color: white;
}
.shop-shopingcart {
width: 1200px;
margin: 20px auto;
display: flex;
flex-direction: column;
flex-wrap: nowrap;
}
/*标题区样式设置开始*/
/*设置该区域整体样式:宽、高、加上底边、为弹性容器、主轴为纵轴、不换行*/
.shop-shopingcart .title {
width: 1200px;
height: 33px;
border-bottom: 2px solid #e6e6e6 ;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
}
/*设置标题区前半段商品信息统计区无序列表样式为弹性容器、横向排列、不换行*/
.shop-shopingcart .title ul {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
}
/*设置列表项的宽高*/
.shop-shopingcart .title li {
/*width: 134px;*/
height: 33px;
font-size: 16px;
color: #3c3c3c;
text-align: center;
}
/*设置信息统计区第一个列表项:全部商品 样式*/
.shop-shopingcart .title li:nth-of-type(1) a {
padding-left: 15px;
padding-right: 30px;
}
/*设置信息统计区第二个列表项:降价商品 样式,并设置左右边框*/
.shop-shopingcart .title li:nth-of-type(2) a{
padding: 0 30px;
border-left: 1px solid gray;
border-right: 1px solid gray;
box-sizing: border-box;
}
/*设置信息统计区第三个列表项:库存紧张 的样式*/
.shop-shopingcart .title li:nth-of-type(3) a{
padding: 0 30px;
}
/*设置信息统计区中所有的信息统计标题字体加粗*/
.shop-shopingcart .title a span:first-of-type{
font-weight: bolder;
}
/*设置信息统计区中所有信息统计数字字体为正常值*/
.shop-shopingcart .title a span:last-of-type {
color: #f40;
margin-left: 5px;
font-weight: normal;
}
/*设置信息统计区第一个区块字体为红色,下边有红色底边*/
.shop-shopingcart .title li:nth-of-type(1) {
border-bottom: 2px solid #f40;
}
.shop-shopingcart .title li:nth-of-type(1) a{
color: #f40;
}
/*设置标题区后半段的结算区靠右*/
.shop-shopingcart .title > div {
margin-left: auto;
height: 33px;
font-size: 12px;
}
/*设置结算价钱的颜色和样式*/
.shop-shopingcart .title > div span:nth-of-type(2) {
color: #f40;
font-weight: 700;
}
/*设置结算按钮的样式*/
.shop-shopingcart .title button {
width: 55px;
background-color: #f40;
color: white;
border-radius: 2px;
border: none;
font-size: 12px;
line-height: 25px;
}
/*标题区样式设置完毕*/
/*商品清单表头样式设置开始*/
.shop-shopingcart .thead {
display: grid;
grid-template-columns: 45px 90px 615px 120px 120px 105px 105px;
grid-template-rows: 50px;
/*grid-template-areas: 'check label info up num total op';*/
align-items: center;
}
.shop-shopingcart .thead input {
margin: 0 15px;
}
.shop-shopingcart .thead label {
margin-left: -5px;
}
.shop-shopingcart .thead input:hover,.shop-shopingcart .thead label:hover{
cursor: pointer;
}
.shop-shopingcart .thead span:first-of-type{
padding-right: 315px;
box-sizing: border-box;
}
/*清单主体区样式设置*/
.shop-shopingcart .cartinfo {
width: 1200px;
display: flex;
flex-direction: column;
flex-wrap: nowrap;
}
/*商品标签样式设置*/
.shop-shopingcart .goodsinfo {
width: 1200px;
display: flex;
flex-direction: column;
flex-wrap: nowrap;
}
/*店铺名称样式设置*/
.shop-shopingcart .shop {
height: 38px;
padding-left: 15px;
font-size: 12px;
line-height: 38px;
display: flex;
}
/*店铺复选框样式设置*/
.shop-shopingcart .shop input {
display: inline-block;
width: 15px;
height: 15px;
align-self: center;
}
/*天猫图标样式*/
.shop-shopingcart .shop img:first-of-type {
width: 16px;
height: 16px;
border-radius: 2px;
align-self: center;
margin-left: 10px;
margin-right: 10px;
}
/*旺旺图标样式*/
.shop-shopingcart .shop img:last-of-type {
width: 20px;
height: 20px;
border-radius: 2px;
align-self: center;
}
/*店名链接样式*/
.shop-shopingcart .shop a {
font-size: 12px;
line-height: 38px;
}
.shop-shopingcart .goodsinfo {
margin-bottom: 15px;
}
/*货物详细清单样式设置*/
.shop-shopingcart .goods {
display: grid;
grid-template-columns: 45px 90px 615px 120px 120px 105px 105px;
grid-template-rows: 130px;
grid-template-areas: 'check pic info up num total op';
padding-top:15px;
box-sizing: border-box;
align-items: start;
border: 1px solid #aaa;
background-color: #fcfcfc;
}
/*货物详细清单复选框样式*/
.shop-shopingcart .goods > input {
justify-self: end;
width: 15px;
height: 15px;
}
.shop-shopingcart .goods > div{
height: 80px;
padding-right: 315px;
box-sizing: border-box;
display: flex;
}
/*设置货物详细清单中货物图片链接的样式*/
.shop-shopingcart .goods > a:first-of-type {
margin-left: 5px;
}
/*设置货物详细清单中文字说明信息部分的样式*/
.shop-shopingcart .goods > div {
display: flex;
flex-direction: column;
justify-content: space-between;
}
.shop-shopingcart .goods span:first-of-type {
color: #3c3c3c;
font-weight: 700;
}
.shop-shopingcart .goods span:last-of-type {
color: #f40;
font-weight: 700;
}
.shop-shopingcart .goods input:last-of-type {
width: 39px;
height: 15px;
justify-self: start;
}
/*设置被选中商品的背景色*/
.shop-shopingcart .goodsinfo:nth-of-type(1) .goods {
background-color:#fff8e1;
}
.shop-shopingcart .goodsinfo:nth-of-type(3) .goods {
background-color:#fff8e1;
}
/*底部样式设置开始*/
.shop-shopingcart .cartfooter {
width: 1200px;
height: 50px;
font-size: 8px;
background-color: #e5e5e5;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
margin:20px 0;
justify-content: space-between;
}
.shop-shopingcart .cartfooter ul {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
/*justify-content: space-between;*/
}
.shop-shopingcart .cartfooter ul li {
font-size: 13px;
color: #404040;
}
.shop-shopingcart .cartfooter ul:first-of-type li:first-of-type {
padding-left: 5px;
}
.shop-shopingcart .cartfooter ul:first-of-type li:nth-of-type(2) {
margin-left: -22px;
}
.shop-shopingcart .cartfooter li {
margin-right:25px;
}
.shop-shopingcart .cartfooter ul:last-of-type a span {
color: #f40;
font-size: 18px;
font-weight: 700;
padding: 0 5px;
}
.shop-shopingcart .cartfooter ul:last-of-type {
margin-left: auto;
}
.shop-shopingcart .cartfooter ul:last-of-type li:nth-of-type(3) {
color: #f40;
font-size: 22px;
font-weight: 400;
padding: 0 5px;
}
.shop-shopingcart .cartfooter button {
width: 120px;
height: 50px;
background-color: #f40;
color: white;
border-radius: 3px;
border:none;
margin-right: 0;
}
footer
@import "../../public/reset.css";
a {
color: #959ba2;
padding: 5px 15px;
}
.public-footer {
width: 100%;
height: 250px;
background-color: #282c31;
color: #959ba2;
padding: 30px;
box-sizing: border-box;
display: grid;
grid-template-columns:130px 550px 400px;
grid-template-rows: 30px 120px;
grid-template-areas:'link link pic' 'logo info pic';
justify-content: center;
}
.public-footer ul {
grid-area: link;
display: flex;
flex-flow: row nowrap;
height: 24px;
}
.public-footer span:first-of-type {
grid-area: logo;
font-size: 30px;
align-self: center;
}
.public-footer div:nth-of-type(1) {
grid-area: info;
}
.public-footer div:nth-of-type(1) p {
height: 40px;
line-height: 40px;
}
.public-footer > div:nth-of-type(2){
grid-area: pic;
padding-left: 40px;
box-sizing: border-box;
border-left: 2.5px solid #000000;
display: flex;
width: 400px;
flex-direction: column;
align-items: start;
}
.public-footer div:nth-of-type(2) span {
font-size: 13px;
width: 360px;
padding-left: 20px;
box-sizing: border-box;
}
.public-footer div:nth-of-type(2) img{
width: 110px;
height: 110px;
margin-top: 10px;
}