老师,这样写可以吗?
来源:5-2 编程练习
 
			慕娘5121658
2018-05-23 00:45:03
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title></title>
    <style>
     /* 在此处补充代码*/
     header {
       display: flex;
       justify-content: space-around;
       background-color: #000;
       height: 100px;
     }
     .nav {
        width: 300px;
        display: flex;
        justify-content: space-between; 
        align-items: center; 
        list-style: none;
        color: #fff;
     }
     .login {
      width: 100px;
      display: flex;
      justify-content: space-between;
      align-items: center;      
     }
     .login > input {
       background-color: rgb(255,164,46);
       color: #fff;
       border: none;
       border-radius: 4px;
     }
      section {
        display: flex;
        flex-wrap: wrap;
        align-content: space-between;
        justify-content: center;
      }
      .section {
        display: flex;
        width: 45%;
        height: 120px;
        margin: 10px;
        justify-content: space-around;
        border-radius: 10px;
        background-color: rgb(168,216,229);
        flex-flow: auto;
      }
      .section > .box {
        display: flex;
        flex-direction: column;
        justify-content: center;
      }
      .btn {
        color: #fff;
        background-color: rgb(255,164,46);
        border-radius: 4px;
        padding: 5px;
        font-size: 14px;
      }
  .shopping {
    align-items:center;
    justify-content: center;
    display: flex;
  }
    </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>《前端小白入门手册》</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回答
 
					好帮手慕星星
2018-05-23
经测试整体效果是不错的呢,还有一个字体颜色改变的:

可以使用:hover伪类来实现一下哦,祝学习愉快~~
相似问题