老师,这样写哪里有需要修改的吗

来源:3-17 编程练习

慕盖茨6136029

2019-09-23 13:47:17

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title></title>
    <style>
     /* 在此处补充代码*/
     *{
        margin: 0;
        padding: 0;
     }
     li{
         list-style: none;
     }
     img{
         display: block;
     }
     header{
        display: flex;
        font-size: 20px;
        color: white;
        justify-content: space-around;
        background: black;
     }
     ul{
         display: flex;
         width: 400px;
         justify-content: space-between;
         align-items: center;
     }
     .login{
         display: flex;
         width: 130px;
         justify-content: space-between;
         align-items: center;
     }
     .login input{
         font-size: 18px;
         color: #ffffff;
         background: orange;
         border: none;
         border-radius: 5px;
         padding: 8px;
     }
     section{
         display: flex;
         flex-wrap: wrap;
         justify-content: space-around;
         font-size: 18px;

     }
     section .section{
         width: 40%;
         height: 150px;
         background: lightblue;
         border: none;
         border-radius: 10px;
         margin-top: 10px;
         display: flex;
         justify-content: space-around;
     }
     .section .box{
         display: flex;
         flex-direction: column;
        justify-content: space-around;
     }
     .shopping{
         display: flex;
         justify-content: center;
         align-items: center;
     }
     .shopping .btn{
         background: orange;
         border-radius: 5px;
         color: #ffffff;
         padding: 10px;
         font-weight: bold;
     }
     .btn:hover{
         color: red;
     }

    </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="登录" class="btn">
       <input type="button" value="注册" class="btn">
     </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回答

好帮手慕星星

2019-09-23

同学你好。

代码整体布局以及实现效果很棒,不需要修改了哦。

祝学习愉快!

0

0 学习 · 6815 问题

查看课程