老师 ,请问3-17题 这样写有问题吗?怎么优化呢

来源:3-17 编程练习

TheRoo

2021-06-10 15:39:15

<!DOCTYPE html>

<html>

  <head>

    <meta charset="UTF-8" />

    <title></title>

    <style>

      /* 在此处补充代码*/

      * {

        margin0;

        padding0;

      }

      body {

        displayflex;

        flex-directioncolumn;

      }

      header {

        width100%;

        displayflex;

        font-size20px;

        justify-contentspace-around;

        background-colorblack;

        margin-bottom20px;

      }


      header .logo img {

        vertical-aligntop;

      }

      header .nav {

        width600px;

        displayflex;

        list-stylenone;

        colorwhite;

        justify-contentspace-around;

        align-itemscenter;

      }


      header .login {

        width150px;

        displayflex;

        justify-contentspace-around;

        align-itemscenter;

      }


      header .login input {

        font-size20px;

        background-colororange;

        colorwhite;


        border-radius5px;

        border0;

        padding2px 6px;

      }


      section {

        width100%;

        height400px;

        displayflex;

        flex-wrapwrap;

        justify-contentspace-around;

      }

      section .section {

        displayflex;

        width40%;

        height150px;

        justify-contentspace-around;

        align-itemscenter;

        background-colorrgb(173216230);

      }

      section .section .box {

        height100%;

        displayflex;

        flex-directioncolumn;

        justify-contentspace-around;

      }

      section .section .btn {

        font-size20px;

        background-colororange;

        colorwhite;


        border-radius5px;

        border0;

        padding2px 6px;

      }


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



写回答

2回答

好帮手慕星星

2021-06-10

同学你好,代码布局以及实现效果很棒,不需要优化了。

继续加油,祝学习愉快~

0

好帮手慕然然

2021-06-10

同学你好,代码实现没问题,继续加油,祝学习愉快!

0

0 学习 · 15276 问题

查看课程