这样写出来是对的吗? 检查一下 老师
来源:3-17 编程练习
一叶知秋_啊
2020-12-10 15:57:19
# 具体遇到的问题
# 报错信息的截图
# 相关课程内容截图
# 尝试过的解决思路和结果
# 粘贴全部相关代码,切记添加代码注释(请勿截图)
在这里输
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style>
/* 在此处补充代码*/
*{
list-style:none;
padding: 0;
margin:0;
}
header{
display: flex;
justify-content: center;
height: 100px;
background-color: black;
}
.logo{
display: flex;
flex:1;
justify-content: center;
align-items: center;
}
header>ul{
display:flex;
flex:1;
justify-content: space-between;
align-items: center;
color: white;
}
header>.login{
display:flex;
flex:1;
justify-content: center;
align-items: center;
}
.login>input{
background-color: orange;
outline:none;
border-radius: 5px;
border: 1px solid black;
}
.login>input:nth-child(1){
margin-right: 10px;
}
section{
width: 100%;
height: 400px;
display:flex;
justify-content: space-around;
align-items: center;
flex-wrap: wrap;
}
section>.section{
border-radius: 2%;
width: 500px;
height: 150px;
background-color: rgb(168, 195, 236);
display: flex;
justify-content: space-around;
align-items: center;
}
.section>.box{
height: 150px;
display:flex;
flex-direction: column;
justify-content: space-around;
align-items: center;
}
.section>.shopping{
display: flex;
border-radius: 10%;
height: 40px;
width: 100px;
background-color: orange;
color: white;
/* font-size: 20px; */
font-weight: bold;
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回答
好帮手慕星星
2020-12-10
同学你好,代码测试效果如下:
1、顶部右侧两个按钮样式不太美观,建议进行完善。添加padding填充空间,将字体颜色变为白色,参考
2、下面小盒子分布不正确。代码中设置小盒子宽度为500px,由于每个显示器的分辨率不同,宽度也会不同,大一些就会导致一行显示超过两个。建议修改小盒子宽度为百分比,参考
3、小盒子中左侧的文字需要左侧对齐显示,不需要居中
祝学习愉快!
相似问题
回答 2
回答 2
回答 1
回答 1
回答 1