请老师检查一下

来源:3-17 编程练习

_Lavender_

2021-03-12 09:53:42

<!DOCTYPE html>

<html>

<head>

    <meta charset="UTF-8">

    <title></title>

    <style>

     *{

         margin0;

         padding0;

     }

     header {

         

         displayflex;

         justify-contentspace-around;

         align-itemscenter;

         background-color#000;

     }


     header .nav {

         list-stylenone;

         displayflex;

         /* align-items: center; */

     }

     header .nav li {

         width120px;

         font-size24px;

         color#fff;

     }

     .login {

         width95px;

         displayflex;

        justify-contentspace-between;

        

     }

     .login input {

         height30px;

         width40px;

         background-colororange;

         color#fff;

         bordernone;

         border-radius4px;

         /* padding-right: 10px; */

     }

     section {

         height500px;

         displayflex;

         flex-wrapwrap;

         /* background-color: orange; */

         /* flex:1; */

          justify-contentspace-around;

         align-contentspace-around

     }

     section .section {

         height200px;

         width640px;

         displayflex;

         justify-contentspace-around;

         background-colorpink;

         border-radius10px;

     }

     section .section .box {

         font-size24px;

         displayflex;

         flex-directioncolumn;

         justify-contentspace-around;

         

         /* align-items: ; */

     }

     section .section  .shopping {

         displayflex;

         align-itemscenter;

         /* background-color: orange; */

     }

     section .section  .shopping .btn {

         displayflex;

         align-itemscenter;

         justify-contentcenter;

         background-colororange;

         height40px;

         width100px;

         color#fff;

         border-radius4px;

     }

    </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回答

好帮手慕夭夭

2021-03-12

同学你好,老师这边测试,内容没有实现两行两列显示,如下:

http://img.mukewang.com/climg/604ad61a09f85aaf19180530.jpg

参考如下调整:

宽度不要使用固定宽度,不然电脑分辨率大的时候,一行可以放下三个盒子了。建议使用百分比设置

http://img.mukewang.com/climg/604ad65c097e51b403180181.jpg

​祝学习愉快~

1

0 学习 · 15276 问题

查看课程