老师帮忙看下
来源:3-17 编程练习
qq_倚楼听风雨_5
2019-12-16 15:17:16
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style>
/* 在此处补充代码*/
*{
margin: 0;padding: 0;
}
li{
list-style: none;
}
header{
width: 100%;
height: 100px;
display: flex;
background: #000;
color: #fff;
justify-content: space-around;
align-items: center;
}
.nav{
display: flex;
justify-content: space-around;
font-size: 20px;
width: 400px;
}
.login{
display: flex;
width: 160px;
justify-content: space-around;
}
.login input{
background: rgb(243,168,60);
outline: none;
border-color: rgb(243,168,60);
color: #fff;
font-size: 18px;
border-radius: 3px;
width: 60px;
height: 30px;
}
.login input:hover{
cursor: pointer;
color: black;
}
section{
display: flex;
justify-content: space-around;
flex-wrap: wrap;
}
.section{
width: 40%;
height: 150px;
background: rgb(182,215,228);
border-radius: 10px;
margin-top: 10px;
display: flex;
justify-content:space-around;
padding: 10px 30px;
}
.box{
display: flex;
flex-direction: column;
flex: 1;
justify-content: space-around;
}
.shopping{
display: flex;
justify-content: center;
align-items: center;
}
.btn{
background: rgb(243,168,60);
width: 100px;height: 40px;
border-radius: 5px;
color: #fff;
display: flex;
justify-content: center;
align-items: center;
font-weight: bold;
cursor: pointer;
}
.btn:hover{
color: red;
}
</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>《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>《HTML5月CSS3实现动态网页》</p>
<div>适用人群:有html和css基础的童鞋</div>
<div>费用:¥599</div>
</div>
<div class="shopping">
<div class="btn">加入购物车</div>
</div>
</div>
</section>
</body>
</html>
1回答
好帮手慕糖
2019-12-16
同学你好,代码是正确的,但是还可以优化一下代码,如下:
顶部的按钮,可以设置下边框为none。

如果我的回答帮助到了你,欢迎采纳,祝学习愉快~
相似问题