老师帮我看下 有没有有没有要修改的?

来源:3-17 编程练习

Rain_2020

2020-01-04 10:20:19

<!DOCTYPE html>

<html>

<head>

    <meta charset="UTF-8">

    <title></title>

    <style>

     /* 在此处补充代码*/

    *{margin: 0;padding: 0; box-sizing: border-box;}

    header{

    width: 100%;

    height: 100px;

    background-color: black;

    padding: 0 50px;

    display: flex;

    justify-content: space-around;

        }

        .logo img{display: block;}

       

        ul.nav{

        list-style: none;

        width: 1000px;

    display: flex;

   

    align-items: center;

    justify-content: center;

        }

        ul.nav li{

        list-style: none;

        color: #FFFFFF;

        padding: 10px 60px;

        font-size: 18px;

        border-radius: 10px;

        font-weight: bold;

        cursor: pointer;  

             

        display: flex;

        justify-content: center;

        align-items: center;     

        }

        ul.nav li:hover{

        background-color: white;

        color: #333333;

        }

    .login{

    width: 138px;   

    display: flex;

    align-items: center;  

    justify-content: space-between;

    } 

    .login input{

    background-color: orange;

    border: none;

    border-radius: 2px;

    color: #FFFFFF;

    font-size: 18px;

    padding: 4px 10px;

    outline: none;

    cursor: pointer;

    }

    section{

    width: 100%;

    display: flex;

    flex-wrap: wrap;

    align-content: flex-start;

    justify-content: space-around; 

    }

    .section{

    width: 650px;

    height: 180px;

    border-radius: 10px;

    background-color: cornsilk;

    margin-top: 20px;   

    display: flex;     

    }

    .box{

    flex: 1;

    padding: 0 0 0 60px;

    line-height: 50px;

    font-size: 18px;

    display: flex;

    flex-direction: column;

    justify-content: center;

    align-content: center;

    align-items: flex-start;

    }

    .shopping{

    height:100%;

    width: 240px;

    display: flex;

    align-items: center;

    justify-content: center;   

    }

    .btn{

    border: none;

    background-color: orange;

    color: #fff;

    font-weight: bold;

    font-size: 18px;

    padding: 10px 18px;

    border-radius: 10px;

    cursor: pointer;

    }

    .btn:hover{

    transition: 0.8s;

    background-color: seagreen;

    }

    

    

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


写回答

2回答

好帮手慕言

2020-01-04

同学你好,在移动端是需要做适配的,在后面的学习中是有讲解的,同学不要着急。

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

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

0
hain_2020
h 好的 谢谢老师
h020-01-04
共1条回复

好帮手慕言

2020-01-04

同学你好,整体效果实现的不错。还有点问题,可参考如下:

1、页面缩小的时候,一行只能显示一个盒子

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

这是因为盒子设置固定宽度,放不下的就被挤下去。建议改为百分比,页面缩小的时候可以跟随变化哦。如下修改即可:

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

2、要求是当鼠标放在按钮上时,按钮上的文字颜色发生变化。同学的是背景颜色发生变化。

建议:在hover时,修改color属性。

祝学习愉快~

0
hain_2020
h 好像这样的话 移动端也有问题呢 这个怎么处理呢 文字溢出来了
h020-01-04
共1条回复

0 学习 · 6815 问题

查看课程