老师还可以优化吗
来源:3-17 编程练习
慕田峪8130438
2021-09-07 10:50:24
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>容器的属性</title>
<style>
* {
margin: 0;
padding: 0;
}
header {
display: flex;
justify-content: space-around;
background-color: #000;
}
header .logo img {
display: block;
}
header .nav {
width: 500px;
list-style: none;
display: inline-flex;
color: #fff;
justify-content: space-between;
align-items: center;
}
header .login {
width: 100px;
display: flex;
justify-content: space-between;
align-items: center;
}
header .login input {
padding: 3px;
background-color: orange;
color: #fff;
border: 0;
border-radius: 2px;
}
section {
display: flex;
justify-content: space-around;
flex-wrap: wrap;
}
.section {
width: 40%;
margin: 20px 0;
height: 150px;
background-color: rgb(116, 221, 224);
border-radius: 10px;
display: flex;
justify-content: space-around;
align-items: center;
}
.box {
height: 100%;
display: flex;
flex-direction: column;
justify-content: space-around;
}
.shopping {
width: 100px;
height: 30px;
background-color: orange;
border-radius: 5px;
display: flex;
justify-content: center;
align-items: center;
color: #fff;
cursor: pointer;
}
</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-09-07
同学你好,效果实现的很棒,代码也很简洁了,可以不用再优化了。祝学习愉快~
相似问题
回答 1
回答 1
回答 1
回答 1
回答 1