老师 ,请问3-17题 这样写有问题吗?怎么优化呢
来源:3-17 编程练习
TheRoo
2021-06-10 15:39:15
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title></title>
<style>
/* 在此处补充代码*/
* {
margin: 0;
padding: 0;
}
body {
display: flex;
flex-direction: column;
}
header {
width: 100%;
display: flex;
font-size: 20px;
justify-content: space-around;
background-color: black;
margin-bottom: 20px;
}
header .logo img {
vertical-align: top;
}
header .nav {
width: 600px;
display: flex;
list-style: none;
color: white;
justify-content: space-around;
align-items: center;
}
header .login {
width: 150px;
display: flex;
justify-content: space-around;
align-items: center;
}
header .login input {
font-size: 20px;
background-color: orange;
color: white;
border-radius: 5px;
border: 0;
padding: 2px 6px;
}
section {
width: 100%;
height: 400px;
display: flex;
flex-wrap: wrap;
justify-content: space-around;
}
section .section {
display: flex;
width: 40%;
height: 150px;
justify-content: space-around;
align-items: center;
background-color: rgb(173, 216, 230);
}
section .section .box {
height: 100%;
display: flex;
flex-direction: column;
justify-content: space-around;
}
section .section .btn {
font-size: 20px;
background-color: orange;
color: white;
border-radius: 5px;
border: 0;
padding: 2px 6px;
}
</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>
2回答
同学你好,代码布局以及实现效果很棒,不需要优化了。
继续加油,祝学习愉快~
好帮手慕然然
2021-06-10
同学你好,代码实现没问题,继续加油,祝学习愉快!
相似问题