5-2编程练习

来源:5-2 编程练习

慕粉1110144175

2019-02-25 16:24:49

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title></title>
    <style>
     /* 在此处补充代码*/
     *{padding: 0;margin: 0;border:none;}
     html{font-size:16px;}
     header{
        display: flex;
        background:#000;
        justify-content: space-around;
        align-items: center;
     }
     .logo{
        display: flex;
        align-items: center;
     }
     .nav{
        display: flex;
        color: #fff;
        font-size:18px;
        width: 28%;
        list-style: none;
        justify-content: space-between;
    } 
     .login{
        display: flex;
        width: 8%;
        justify-content: space-between;
    }
     .login>input{
        color: #fff;
        background:orange;
        border-radius: 3px;
        padding: 5px;
    }
    section{
        display: flex;
        flex-wrap: wrap;
        justify-content: space-around;
    }
    section>.section{
       margin-top: 20px;
       width: 45%;
       height: 200px;
       border-radius: 10px;
       background: #ADD8E6;
       display:flex;
       justify-content: space-around;
       align-items: center;
    } 
    section>.section>.box{
        display: flex;
        flex-direction: column;
        font-weight: bold;
    }
    section>.section>.box>p,
    section>.section>.box>div{
        margin: 1rem 0;
    }
    section>.section>.shopping{
        color: #fff;
        font-size: 18px;
        font-weight: bold;
        background: orange;
        padding: 6px 10px;
        border-radius: 5px;
    }
    </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回答

好帮手慕星星

2019-02-25

你好,代码实现效果是不错的,继续加油!

0

0 学习 · 5012 问题

查看课程

相似问题