5-2老师检查一下

来源:5-2 编程练习

Lolita95

2018-11-20 21:05:24

<!DOCTYPE html>

<html>

<head>

    <meta charset="UTF-8">

    <title></title>

    <style>

*{padding:0;

margin:0;}

ul{list-style:none;}

header{

background:black;

font-size:20px;

color:white;

display:flex;

justify-content:space-around;

align-items:center;

  }

  

.nav{

width:30%;

display:flex;

justify-content:space-between;

}

.login{

width:10%;

display:flex;

justify-content:space-around;

  }

  

.login>input{

background:orange;

color:white;

border:none;

font-size:16px;

border-radius:10%;

padding:5px;

}

section{

width:100%;

font-size:16px;

display:flex;

flex-wrap: wrap; 

justify-content: space-between;

}

.section{

width:40%;

height:100px;

background:rgb(149,202,202);

margin: 10px 30px;

border-radius:5px;

display:flex;

justify-content:space-between;

padding:25px;

}

.box{

display:flex;

flex-direction:column;

justify-content:space-between;

}

.shopping{

display:flex;

align-items:center;

}

.btn{

background:orange;

font-size:18px;

color:white;

border-radius:5px;

padding:8px;

}

.btn:hover{color:red;}

    </style>

</head>

<body>

   <header>

     <div class="logo">

       <img src="http://climg.mukewang.com/59feb59700019dab01910057.png" 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回答

好帮手慕星星

2018-11-21

logo图片与父级元素高度不一致,如下:

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

有一点缝隙,是因为图片本身是inline-block元素,默认有缝隙存在,所以会有这种情况,可以将图片变为block元素。

实现效果还是可以的,继续加油!

0

0 学习 · 5012 问题

查看课程