请老师帮忙看看对不对有什么需要改进的~~~两行效果就是复制section吗?
来源:5-2 编程练习
Oo君陌oO
2019-02-15 15:39:02
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
*{
padding:0;
margin:0;
}
html{
font-size:16px;
}
header{
background: black;
display:flex;
justify-content: space-between;
padding:0 4rem;
box-sizing: border-box;
align-items: center;
}
.logo img{
display: block;
}
.nav{
width: 30%;
display: flex;
justify-content: space-between;
color: #fff;
list-style: none;
font-size: 1.3rem;
}
.login{
display:flex;
}
.login input{
width: 3.1rem;
height:2.1rem;
outline: none;
border: none;
background: orange;
color: #fff;
display: block;
border-radius:0.3rem;
font-size:1rem;
}
.login input:nth-child(1){
margin-right:15px;
}
section{
display: flex;
}
.section{
display:flex;
background: #add8e6;
flex:1;
border-radius:8px;
margin:1rem 2rem;
justify-content: space-between;
align-items: center;
padding:1rem 4rem ;
box-sizing: border-box;
}
.section .box{
display: flex;
flex-direction: column;
font-size: 1.5rem;
}
.section .box div,.section .box p{
margin:1.1rem 0;
}
.section .shopping .btn{
background: orange;
color: #fff;
width: 8rem;
text-align: center;
line-height: 3rem;
font-weight: bold;
font-size: 1.2rem;
border-radius:0.3rem;
}
</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>
</section>
<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>
</section>
</body>
</html>1回答
你好,代码实现效果是不错的,两行效果将section标签复制一下就可以,没有问题。
祝学习愉快!
相似问题