麻烦老师检查下,还有什么优化的地方没有
来源:3-17 编程练习
weixin_慕沐1378591
2021-02-16 18:49:20
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style>
/* 在此处补充代码*/
/* body{
display: flex;
width: 100%;
} */
*{
padding: 0;
margin: 0;
}
header{
display: flex;
width: 100%;
justify-content: center;
align-items: center;
background-color:black;
justify-content: space-around;
}
.nav{
list-style: none;
display: flex;
width: 600px;
justify-content: space-around;
color: white;
cursor: pointer;
font-size: 22px;
}
.login{
display: flex;
width: 170px;
justify-content: space-between;
}
.login input{
outline: none;
border: none;
background-color: orange;
width: 60px;
border-radius: 5px;
font-size: 17px;
color: white;
height: 30px;
cursor: pointer;
}
section{
height: 400px;
margin-top: 30px;
display: flex;
flex-wrap: wrap;
justify-content: space-around;
align-items: center;
}
.section{
background-color: rgba(173, 216, 230);
width: 45%;
display: flex;
border-radius: 10px;
height: 180px;
justify-content: space-around;
}
.box{
display: flex;
flex-direction: column;
font-size: 18px;
}
.box p,.box div {
/* padding-left: 20px; */
display: flex;
flex: 1;
justify-content: flex-start;
align-items: center;
}
.shopping{
display: flex;
background-color: orange;
color: white;
height: 40px;
width: 100px;
border-radius: 10px;
align-items: center;
justify-content: center;
cursor: pointer;
align-self: center;
}
</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>《从H5页面开发到移动端响应式开发》</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>《从H5页面开发到移动端响应式开发》</p>
<div>适用人群:有html和css基础的童鞋</div>
<div>费用:¥599</div>
</div>
<div class="shopping">
<div class="btn">加入购物车</div>
</div>
</div>
</section>
</body>
</html>
1回答
同学你好,代码正确,不需要优化了,很棒,祝学习愉快!
相似问题
回答 1
回答 1
回答 1
回答 1
回答 1