老师我这样写代码可以吗?
来源:5-2 编程练习
慕仔2455976
2018-08-04 10:44:03
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style>
/* 在此处补充代码*/
*{
margin: 0;
padding: 0;
font-size: 16px;
}
header{
height: 100px;
background: #000;
display: flex;
justify-content: space-around;
}
.logo,.nav,.login{
width: 33%;
display: flex;
justify-content: center;
align-items: center;
flex: 1;
}
.nav{
color: #fff;
display: flex;
justify-content: space-around;
}
.nav li{
font-size: 20px;
}
.login input{
font-size: 20px;
}
input{
margin: 0 20px;
background: orange;
color: #fff;
border: none;
border-radius: 5px;
}
section{
display: flex;
justify-content: center;
}
.section{
background: #9FD0E1;
width: 450px;
height: 150px;
border-radius: 5px;
margin: 10px 40px;
display: flex;
justify-content: space-between;
padding: 10px 40px;
}
.box{
display: flex;
flex-direction: column;
justify-content: center;
}
.box p,.box div{
margin-bottom: 15px;
}
.shopping{
display: flex;
align-items: center;
}
.btn{
width: 100px;
height: 40px;
background: orange;
color: #fff;
border-radius: 5px;
text-align: center;
line-height: 40px;
}
</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>
<section>
<div class="section">
<div class="box">
<p>《从H5网页开发到移动端响应式开发》</p>
<div>适用人群:有html、css、js、jQ基础的童鞋</div>
<div>费用:¥599</div>
</div>
<div class="shopping">
<div class="btn">加入购物车</div>
</div>
</div>
<div class="section">
<div class="box">
<p>《从H5网页开发到移动端响应式开发》</p>
<div>适用人群:有html、css、js、jQ基础的童鞋</div>
<div>费用:¥599</div>
</div>
<div class="shopping">
<div class="btn">加入购物车</div>
</div>
</div>
</section>
</body>
</html>
1回答
妮可妮可妮_
2018-08-04
1. 
根据习题要求:
建议使用:hover伪元素设置其鼠标移入的样式,可参考下图所示:

2. 建议使用list-style: none;将ul li的默认小圆点去掉,可参考下图所示:

祝学习愉快!
相似问题