麻烦老师看一下,还有哪里需要优化的。

来源:3-17 编程练习

慕码人2001750

2021-08-10 23:56:31

​<!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>


写回答

1回答

好帮手慕星星

2021-08-11

同学你好,代码布局以及实现效果很棒,不需要优化了。继续加油,祝学习愉快!

0

0 学习 · 15276 问题

查看课程