麻烦老师看一下,还有哪里需要优化的。
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style>
* {
margin: 0;
padding: 0;
}
body {
display: flex;
flex-direction: column;
}
header {
width: 100%;
background-color: #000;
font-size: 20px;
display: flex;
justify-content: space-around;
align-items: center;
}
header .logo img {
vertical-align: top;
}
header .nav {
width: 35%;
color: white;
list-style: none;
display: flex;
align-items: center;
align-content: space-around;
}
header .nav li {
flex: 1;
display: flex;
justify-content: center;
}
header .login {
width: 8.5%;
display: flex;
justify-content: space-between;
}
header .login input {
background-color: orange;
font-size: 20px;
border-radius: 5px;
color: white;
border: none;
padding: 3px 5px;
}
section {
height: 340px;
width: 100%;
display: flex;
flex-wrap: wrap;
align-content: space-around;
justify-content: space-around;
}
section .section {
width: 45%;
height: 150px;
border-radius: 10px;
background-color: rgb(173, 216, 230);
display: flex;
justify-content: space-around;
align-items: center;
}
section .section .box {
height: 100%;
display: flex;
flex-direction: column;
justify-content: space-around;
}
section .section .shopping {
display: flex;
align-items: center;
}
section .section .shopping .btn {
color: white;
font-size: 20px;
padding: 2px 6px;
background-color: orange;
border-radius: 5px;
}
</style>
</head>
<body>
<!-- 头部 -->
<header>
<div class="logo">
<img src="http://img1.sycdn.imooc.com\/climg/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>
9
收起
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星