老师麻烦检查一下

来源:3-17 编程练习

qq_慕丝1448851

2020-07-23 20:53:24

<!DOCTYPE html>

<html>

<head>

    <meta charset="UTF-8">

    <title></title>

    <style>

     /* 在此处补充代码*/

     *{

       margin: 0;

       padding: 0;

       list-style: none;

     }

     header{

       height: 100px;

       background-color: #000;

       display: flex;

       justify-content:space-around;

       align-items: center;

     }

     .nav,

     .login{

       color: white;

     }

     .login,

     .nav{

       display: flex;

       width: 400px;

       justify-content: space-between;

       align-items: center;

     }

     .login{

       width: 100px;

     }

     body{

       display: flex;

       flex-direction: column;

     }

     section{

       display: flex;   

       flex-wrap: wrap;

       justify-content: center;

       align-items: center;

     }

     

     .section{

       background-color: lightblue;

       margin: 30px;

       border-radius: 30px;

       width: 800px;

       height: 200px;

       display: flex;

       justify-content: space-around;

       align-items: center;

     }

     .box{

       font-size: 24px;

       height: 100%;

       display: flex;

       flex-direction: column;

       justify-content: space-around;

     }

     .shopping{

      font-size: 20px;

       width: 130px;

       height: 50px;

       background-color: orange;

       border-radius: 10px;

       display: flex;

       justify-content: center;

       align-items: center;

       color: white;

     }

     .shopping:hover{

       background-color: lightsalmon;

       color: lightskyblue;

     }

     

    </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>《前端小白入门手册》</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>

    </section>

</body>

</html>


写回答

1回答

好帮手慕夭夭

2020-07-24

同学你好,问题与修改如下:

1.按钮没有设置字体颜色和背景色等样式。

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

参考如下设置:

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

2.元素设置固定宽度,当页面缩小之后,以后放不下就会挤下去。如下图所示:

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

所以建议使用百分比设置宽度更好,参考如下修改:

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

如果我的回答帮到了你,欢迎采纳,祝学习愉快~

0

0 学习 · 6815 问题

查看课程