老师检查一下,看看有没有问题

来源:5-2 编程练习

人艰不拆OMG

2018-09-27 17:12:37

<!DOCTYPE html>

<html>

<head>

    <meta charset="UTF-8">

    <title></title>

    <style>

        *{

            margin:0;

            padding:0;

            list-style:none;

        }

        header{

            display:flex;

            justify-content:space-around;

            align-items:center;

            width:100%;

            background:black;

        }

        .nav{

        display:flex;

            width:300px;

            align-items:center;

            justify-content:space-around;

            color:#fff;

        }

        .login{

        display:flex;

            width:100px;

            justify-content:space-around;

        }

        input{

            background:orange;

            outline:none;

            border:1px solid orange;

            border-radius:3px;

            color:#fff;

        }

        section{

        display:flex;

        margin-top: 10px;

            justify-content:space-around;

        }

        .section{

            margin:0 40px;

            border-radius: 5px;

            background: #89dbd2;

            display:flex;

            flex-grow: 1;

            justify-content:space-around;

        }

        .box{

        display:flex;

        flex-direction:column;

        justify-content:center;

        }

        .box p,.box div{

            padding:5px 0;

        }

        .shopping{

display:flex;

            align-self:center;

        }

        .btn{

            padding:10px;

            background:orange;

            display:flex;

            justify-content:center;

            align-items:center;

            border-radius:5px;

            color: #fff;

        }

        .login input:hover{

            background:red;

            border:1px solid red;

            color:yellow;

        }

        .btn:hover{

            background:red;

            color:yellow;

        }

    </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-09-27

练习效果如下 , 建议设置高度 ,并把文字垂直方向上平分:

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

代码修改如下:

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

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

完善一下吧 ,祝学习愉快 ! 望采纳


0

0 学习 · 5012 问题

查看课程