这样写出来是对的吗? 检查一下 老师

来源:3-17 编程练习

一叶知秋_啊

2020-12-10 15:57:19

# 具体遇到的问题

# 报错信息的截图

# 相关课程内容截图

# 尝试过的解决思路和结果

# 粘贴全部相关代码,切记添加代码注释(请勿截图)

在这里输

<!DOCTYPE html>

<html>

<head>

    <meta charset="UTF-8">

    <title></title>

    <style>

     /* 在此处补充代码*/

     *{

         list-style:none;

         padding0;

         margin:0;

     }

     header{

         displayflex;

         justify-contentcenter;

        height100px;

        background-colorblack;

     }

     .logo{

         displayflex;

         flex:1;

         justify-contentcenter;

         align-itemscenter;

     }

     header>ul{

         display:flex;

         flex:1;

         justify-contentspace-between;

         align-itemscenter;

         colorwhite;

     }

     header>.login{

         display:flex;

         flex:1;

         justify-contentcenter;

         align-itemscenter;

     }

     .login>input{

         background-colororange;

         outline:none;

         border-radius5px;

         border1px solid black;

     }

     .login>input:nth-child(1){

         margin-right10px;

     }


     section{

         width100%;

         height400px;

         display:flex;

         justify-contentspace-around;

         align-itemscenter;

        flex-wrapwrap;

     }

   section>.section{

       border-radius2%;

         width500px;

         height150px;

         background-colorrgb(168195236);

         displayflex;

         justify-contentspace-around;

         align-itemscenter;

     } 

     .section>.box{

        height150px;

         display:flex;

         flex-directioncolumn;

         justify-contentspace-around;

         align-itemscenter;

     }

     .section>.shopping{

         displayflex;

         border-radius10%;

         height40px;

         width100px;

         background-colororange;

         colorwhite;

         /* font-size: 20px; */

         font-weightbold;

         justify-contentcenter;

        align-itemscenter;

     }

      

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

同学你好,代码测试效果如下:

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

1、顶部右侧两个按钮样式不太美观,建议进行完善。添加padding填充空间,将字体颜色变为白色,参考

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

2、下面小盒子分布不正确。代码中设置小盒子宽度为500px,由于每个显示器的分辨率不同,宽度也会不同,大一些就会导致一行显示超过两个。建议修改小盒子宽度为百分比,参考

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

3、小盒子中左侧的文字需要左侧对齐显示,不需要居中

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

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

祝学习愉快!

0

0 学习 · 15276 问题

查看课程