5-2卡片布局作业,这样写符合要求吗?
来源:5-2 编程练习
慕娘5121658
2018-05-23 11:52:32
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>作业5-2:Card 布局</title>
<style>
header {
display: flex;
justify-content: space-around;
align-items: center;
background-color: #000;
height: 100px;
}
.logo {
font-size: 0;
}
.nav {
width: 300px;
display: flex;
justify-content: space-between;
align-items: center;
list-style: none;
color: #fff;
}
.login {
width: 100px;
display: flex;
justify-content: space-between;
align-items: center;
}
.login > input {
background-color: rgb(255,164,46);
color: #fff;
border: none;
border-radius: 4px;
}
section {
display: flex;
flex-wrap: wrap;
align-content: space-around;
justify-content: space-around;
}
.section {
display: flex;
width: 45%;
height: 120px;
margin: 10px;
justify-content: space-around;
border-radius: 10px;
background-color: rgb(168,216,229);
flex-flow: 1;
}
.section > .box {
display: flex;
flex-direction: column;
justify-content: center;
}
.btn {
color: #fff;
background-color: rgb(255,164,46);
border-radius: 4px;
padding: 5px;
font-size: 14px;
}
.login > input:hover,
.btn:hover {
color: #ddd;
}
.shopping {
align-items:center;
justify-content: center;
display: flex;
}
</style>
</head>
<body>
<!-- 头部 -->
<header>
<div class="logo">
<img src="http://climg.mukewang.com/59197ab000014f1503000100.jpg" alt="">
</div>
<ul class="nav">
<li>课程</li>
<li>路径</li>
<li>猿问</li>
<li>手记</li>
</ul>
<div class="login">
<input type="button" value="登录">
<input type="button" value="注册">
</div>
</header>
<!-- 主体内容 -->
<section>
<div class="section">
<div class="box">
<p>《前端小白入门手册》</p>
<div>适用人群:没有任何前端基础的小白</div>
<div>费用:¥499</div>
</div>
<div class="shopping">
<div class="btn">加入购物车</div>
</div>
</div>
<div class="section">
<div class="box">
<p>《HTML5月CSS3实现动态网页》</p>
<div>适用人群:有html和css基础的童鞋</div>
<div>费用:¥599</div>
</div>
<div class="shopping">
<div class="btn">加入购物车</div>
</div>
</div>
<div class="section">
<div class="box">
<p>《前端小白入门手册》</p>
<div>适用人群:没有任何前端基础的小白</div>
<div>费用:¥499</div>
</div>
<div class="shopping">
<div class="btn">加入购物车</div>
</div>
</div>
<div class="section">
<div class="box">
<p>《HTML5月CSS3实现动态网页》</p>
<div>适用人群:有html和css基础的童鞋</div>
<div>费用:¥599</div>
</div>
<div class="shopping">
<div class="btn">加入购物车</div>
</div>
</div>
</section>
</body>
</html>1回答
好帮手慕夭夭
2018-05-23
经过测试 , 效果实现了 ,可以把如下注释的去掉哦,

继续加油 , 祝学习愉快 !
相似问题