老师这样可以吗?

来源:5-2 编程练习

不揣摩不参与

2019-06-14 22:11:02

<!DOCTYPE html>

<html>

<head>

    <meta charset="UTF-8">

    <title></title>

    <style>

     /* 在此处补充代码*/

     header{

         display:flex;

         justify-content:space-around;

         align-items:center;

         background:black;

         color:white;

     }

     .nav{

         width:300px;

         list-style:none;

         display:flex;

         justify-content:space-between;

     }

     .login{

         width:100px;

         display:flex;

         justify-content:space-between;

     }

     section{

         

         display:flex;

         justify-content:space-around;

         flex-wrap:wrap;

     }

     .section{

         margin-top:20px;

         background:green;

         display:flex;

         justify-content:space-around;

         height:150px;

         width:450px;

     }

     .shopping{

         display:flex;

         align-items:center;

     }

     .box{

         display:flex;

         flex-direction:column;

         justify-content:center;

         

     }

     .btn{

         width:100px;

         background:pink;

         color:white;

         border-radius:5px;

         text-align: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>

这样实现的一行两个section方法是不是不太好,宽度变小的时候就会变成一个,有什么更好的办法吗

写回答

1回答

Miss路

2019-06-15

同学,你好。

效果可以。继续加油!

祝学习愉快!

0

0 学习 · 5012 问题

查看课程