小帮手们帮忙看下需要改进的不?

来源:3-17 编程练习

好帮手慕斯林

2021-02-04 10:35:21

相关代码:

<html>

<head>
<meta charset="UTF-8">
<title></title>
<style>
/* 在此处补充代码*/
* {
margin: 0;
padding: 0;
list-style: none;
}

header {
display: flex;
background-color: black;
justify-content: space-around;
align-items: center;
}

.logo img {
display: block;
}

.nav {
display: flex;
justify-content: space-around;
width: 300px;
color: white
}

.login {
display: flex;
justify-content: space-around;
width: 100px;
}

.login input {
border: none;
padding: 2px 4px;
background: orange;
border-radius: 3px;
color: white;
}

section {
width: 100%;
height: 300px;
display: flex;
flex-wrap: wrap;
justify-content: space-around;
align-content: space-around;

}

.section {
flex-basis: 45%;
height: 140px;
border-radius: 10px;
display: flex;
justify-content: space-around;
align-items: center;
background-color: rgb(188, 251, 255);
}

.box {
height: 80%;
display: flex;
flex-direction: column;
justify-content: space-around;
}
.shopping{
width: 100px;
height: 40px;
background-color:orange;
color: white;
font-weight:bold ;
display: flex;
border-radius: 5px;
justify-content:center;
align-items: 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>《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回答

好帮手慕言

2021-02-04

同学你好,整体实现的不错,如果section元素的高度再调整大一些,页面效果会更美观,例如:
http://img.mukewang.com/climg/601bb90f09bb491b03760169.jpg

祝学习愉快~

0

0 学习 · 15276 问题

查看课程