请问还有需要修改的地方么~~~

来源:5-2 编程练习

七十七个七

2019-03-14 19:00:13

<!DOCTYPE html>

<html>

<head>

    <meta charset="UTF-8">

    <title></title>

    <style>

     /* 在此处补充代码*/

     *{

        padding: 0;

        margin: 0;

     }

     header{

        width: 100%;

        height: 100px;

        background: #000;

        display: flex;

        justify-content: space-around;

        align-items: center;

        flex: wrap;

     }

     .logo{

      height: 100%;

     }

     .logo>img{

      height: 100%;

     }

     .nav{

        width: 600px;

        display: flex;

        color: #fff;

        list-style: none;

        flex: wrap;

        justify-content: space-around;

        font-size: 18px;

      }

      .login{

        width: 200px;

        display: flex;

        flex: wrap;

        justify-content: space-around;

      }

      .login>input{

        width: 58px;

        height: 39px;

        border-radius: 3px;

        background: #ffa500;

        border: 1px solid #ffa500;

        color: #fff;

        font-size: 18px;

      }

      section{

        width: 100%;

        height: 500px;

        display: flex;

        flex-wrap: wrap;

        justify-content: space-around;

        align-items: center;

      }

      .section{

        width: 864px;

        height: 200px;

        background: #add8e6;

        border-radius: 9px;

        display: flex;

        justify-content: space-around;

        align-items: center;

      }

      .box{

        width: 370px;

        height: 150px;

        display: flex;

        flex-wrap: wrap;

        align-content: space-between;

        font-size: 18px;

        font-weight: bold;

      }

      .btn{

        width: 150px;

        height: 60px;

        background: #ffa500;

        border-radius: 9px;

        text-align: center;

        line-height: 60px;

        font-weight: bold;

        color: #fff;

        font-size: 20px;

      }

      .btn:hover{

          color: #000;

          cursor: pointer;

      }

    </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>《从H5网页开发到移动端响应式开发》</p>

        <div>适用人群:有html、css、js、jQ基础的童鞋</div>

        <div>费用:¥599</div>

      </div>

      <div class="shopping">

        <div class="btn">加入购物车</div>

      </div>

    </div>

    <div class="section">

      <div class="box">

        <p>《从H5网页开发到移动端响应式开发》</p>

        <div>适用人群:有html、css、js、jQ基础的童鞋</div>

        <div>费用:¥599</div>

      </div>

      <div class="shopping">

        <div class="btn">加入购物车</div>

      </div>

    </div>

    </section>  

</body>

</html>


写回答

1回答

好帮手慕星星

2019-03-14

你好,经测试在全屏下没有问题的,但是将浏览器宽度上稍微缩小一点,下面布局方式就不对了:

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

代码中.section设置的是固定宽度864px,建议设置成百分比的形式,参考:

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

可以重新测试下,祝学习愉快!

0

0 学习 · 5012 问题

查看课程