请老师检查下哪里需要优化,另外问下logo是否需要设置width?

来源:3-17 编程练习

勇敢的心lh2020

2020-03-30 21:36:03

<!DOCTYPE html>

<html>

<head>

    <meta charset="UTF-8">

    <title></title>

    <style>

        *{

            margin: 0;

            padding: 0;

            list-style: none;

            text-decoration: none;

            box-sizing: border-box;

        }

        img{

            /* 图片去掉边框线 */

            display: block; 

        }

        body{

            width: 100%;

            background: burlywood;

            display: flex;

            flex-direction: column;

        }

        header{

            display: flex;

            background: #000;

            color: #fff;

            font-size: 18px;

            justify-content: space-around;

            align-items: center;

        }

        /* header .logo{

            width: 26%;

        } */

        header ul{

            width: 40%;

            display: flex;

            font-size: 22px;

            justify-content: space-around;

        }

        header .login{

            width: 150px;

            display: flex;

            justify-content: space-around;

        }

        header .login input{

            width: 50px;

            height: 36px;

            line-height: 36px;

            background: orange;

            color: #fff;

            font-size: 18px;

            border-radius: 3px;

            border: none;

        }


        section{

            width: 100%;

            height: 360px;

            background: #fff;

            display: flex;

            justify-content: space-around;

            flex-wrap: wrap;

            /* flex-flow: wrap; */

            /* flex: 1; */

            align-items: center;

        }

        section .section{

            width: 44%;

            height: 40%;

            border-radius: 10px;

            display: flex;

            background: rgb(75, 213, 218);

            justify-content: space-around;

            align-items: center;

        }

        section .section .box{

            display: flex;

            height: 100%;

            flex-direction: column;

            flex-wrap: wrap;

            justify-content: space-around;

        }

        section .section .shopping{

            background: #fff;

            width: 90px;

            text-align: center;

            line-height: 40px;

            border-radius: 5px;

            background: orange;

            color: #fff;

        }

        section .section .shopping:hover{

            color: green;

        }

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

好帮手慕慕子

2020-03-31

同学你好,效果实现的很棒,代码也很简洁,不用在优化了,logo不需要设置宽度。

继续加油,祝学习愉快~

0

0 学习 · 6815 问题

查看课程