5-2编程练习1是这样的吗

来源:5-2 编程练习

yjw123

2018-02-06 00:41:18

<!DOCTYPE html>

<html>

<head>

    <meta charset="UTF-8">

    <title></title>

    <style>

    *{

        padding:0;

        margin:0;

    }

     header{

        background:#000;

        display: flex;

     }

     header > div,header > ul{

        flex-grow: 1;

     }

     .nav{

        color:#fff;

        font-weight: bold;

        font-size:25px;

        display: flex;

        flex-grow: 3;

     }

     .nav li{

        display: block;

        flex-grow: 1;

        display: flex;

        align-items: center;

     }

     .login{

        display: flex;

        justify-content: space-around;

        align-items: center;

     }

     .login input{

        width: 40px;

        height: 30px;

        background-color:orange;

        color:#fff;

        border:none;

     }

     /*主体内容*/

     section{

        padding:20px 40px;

        display: flex;

        justify-content:space-around;

     }

     .section > .shopping{

        width: 100px;

        height: 40px;

        text-align: center;

        line-height: 40px;

        background: orange;

        border-radius:10px;

     }

     section > .section{

        width: 500px;

        height: 120px;

        background:#00b7ee;

        color:#fff;

        padding:20px;

        display: flex;

        justify-content: space-between;

        align-items: center;

     }

     .section > .box{

        color:#000;

        line-height: 2em;

        display: flex;

        flex-direction:column;

        justify-content:center;

     }

     .section > .shopping{

        display: flex;

        justify-content: 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>

    </section>  

</body>

</html>


写回答

1回答

古月大玉

2018-02-06

经测试,效果基本达到。但是有细节需要调整,头部的登录注册按钮间隔太大。左侧慕课网logo应该居中。下方卡片内容间隔较大。

0
hjw123
h 非常感谢!
h018-02-07
共1条回复

0 学习 · 5012 问题

查看课程