请老师批改

来源:3-17 编程练习

weixin_慕斯卡1279472

2021-03-13 23:08:52

<!DOCTYPE html>
<html>

<head>
<meta charset="UTF-8">
<title></title>
<style>
* {
box-sizing: border-box;
padding: 0;
margin: 0;
}

li {
list-style: none;
}

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

.nav {
display: flex;
color: #fff;
font-size: 30px;
justify-content: space-around;
}

.nav>li {
width: 100px;
}

.login>input[type='button'] {
background-color: orange;
outline: none;
border: none;
width: 50px;
height: 30px;
color: #fff;
font-weight: bold;
}

section {
display: flex;
justify-content: space-around;
margin: 20px;
}

.section {
width: 500px;
height: 150px;
background-color: #add8e6;
border-radius: 15px;
padding: 15px;
display: flex;
align-items: center;
justify-content: space-around;
}

.btn {
color: white;
background-color: orange;
width: 100px;
text-align: center;
height: 40px;
line-height: 40px;
border-radius: 10px;
font-weight: 600;
}

.box {
height: 150px;
display: flex;
flex-direction: column;
justify-content: space-around;
}
</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>
</section>
</body>

</html>


写回答

1回答

好帮手慕久久

2021-03-14

同学你好,代码中有如下问题:

1、将主体内容元素增加至四个时,元素都在一行显示:

http://img.mukewang.com/climg/604d74070907607618930384.jpg

正常应该分两行显示。建议调整子元素的宽度,让一行只显示两个,如下:

http://img.mukewang.com/climg/604d750309f3f53c07300686.jpg

2、头部右侧按钮,缺少圆角,并且彼此之间的距离有点近:

http://img.mukewang.com/climg/604d75350903bcdd02660088.jpg

建议添加圆角并调整二者之间的间距:

http://img.mukewang.com/climg/604d757f09562d5405400350.jpg

祝学习愉快!​


0

0 学习 · 15276 问题

查看课程