3-17检查一下?

来源:3-17 编程练习

ZZZZZzn

2020-07-01 16:34:56

<!DOCTYPE html>

<html>

<head>

    <meta charset="UTF-8">

    <title></title>

    <style>

     header{

      width: 100%;

      display: flex;

      justify-content: space-around;

      background: black;

      align-items: center;

      }

      .nav{

        width: 30%;

        display: flex;

        justify-content: space-around;

        color:#fff;

      }

      .nav li{

        list-style: none;

      }

      .login input{

      outline: none;  

      border: none;

      background: yellow; 

      }

      section{

      display: flex;

      flex-wrap: wrap;

      justify-content: space-around;

      }

      .section{

       width: 40%;

       height: 120px;

       background: #33FFCC;

       border-radius: 10px;

       display: flex;

       justify-content: space-around;

       align-items: center;

       margin-top: 20px;

      }


      .box{

             height: 100%;

             display: flex;

             justify-content: space-around;

             flex-direction: column;

             align-items: flex-start;

      }

      .btn{

        width: 80px;

        height: 30px;

        background: orange;

        border-radius: 5px;

        display: flex;

        justify-content: center;

        align-items: center;

        color: #fff;

        font-size: 15px;

      }

      .btn:hover{

        cursor: pointer;

        color: black;

      }

    </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回答

好帮手慕粉

2020-07-01

同学你好,实现的效果是正确的哦,可以将元素的默认间隙去除掉:

http://img.mukewang.com/climg/5efc52b30990aa0403780128.jpg

这块的内容确实有点饶,刚学习这块不熟悉是很正常的呢,同学可以多听下视频,多练习呢。

祝学习愉快~

0

0 学习 · 6815 问题

查看课程