老师,检查一下,有没有完善的地方,谢谢

来源:3-17 编程练习

喝牛奶对身体好

2020-09-09 21:18:11

<!DOCTYPE html>

<html>

<head>

    <meta charset="UTF-8">

    <title></title>

    <style>

      *{margin:0;padding:0;list-style:none;}

    header{

      background:black;

      display: flex;

      justify-content: space-around;

      align-items: center;

      height:80px;

    }

    .logo{

      height:80px;

    }

    .logo img{height:100%;}

    .nav,.login{

      display: flex;

      justify-content:space-between;

    }

    .nav{

      width:520px;

      color:white;

    }

    .login input{

      color:white;

      background-color:orange;

      border:none;

      align-items:center;

      margin-right:10px;

      padding:4px;

      border-radius:2px;

    }

    section{

      display: flex;

      flex-wrap:wrap;

      justify-content:space-around;

    }

    .section{

      background-color:#add8e6;

      padding:10px 20px;

      display: flex;

      border-radius:5px;

      box-sizing:border-box;

      width:40%;

      margin:10px 0;

      justify-content: space-between;

      align-items:center;

     

    }

    .shopping{

      color:white;

      background-color:orange;

      padding:5px;

      border-radius:5px;

    }

    p,.box div{

      line-height:2em;

    }

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

好帮手慕慕子

2020-09-10

同学你好,整体效果实现的不错,有一个细节需要注意下,如下所示:注册按钮右侧有间距,导致头部整体内容水平居中存在误差。

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

建议:只给登录按钮设置右间距,调整按钮之间的间距就可以了。

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

如果我的回答帮助到了你,欢迎采纳 ,祝学习愉快 ~

0

0 学习 · 6815 问题

查看课程