请老师帮忙看一哈

来源:3-17 编程练习

qq_火柴_eP0246

2019-05-30 12:50:53

<!DOCTYPE html>
<html>
<head>
   <meta charset="UTF-8">
   <title></title>
   <style>
       /* 在此处补充代码*/
       * {
           margin: 0;
           padding: 0;
       }

       header {
           border: 1px solid red;
           background-color: white;
           display: flex;
           justify-content: space-around;
           align-items: center;
       }

       .logo img {
           display: block;
       }

       .nav {
           width: 300px;
           display: flex;
           list-style: none;
           justify-content: space-between;
           background-color: #528CE0;
       }

       .nav li {
           font-size: 20px;
           color: white;
       }

       .login {
           background-color: #5E740B;
           display: flex;
           justify-content: space-between;
           width: 100px;
       }

       .login-btn {
           width: 40px;
           height: 20px;
           border-radius: 5px;
           background-color: orange;
       }

       section {
           border: 1px solid black;
           display: flex;
           flex-wrap: wrap;
           justify-content: space-around;
       }

       .section {
           margin: 10px 0 0 0;
           width: 45%;
           height: 150px;
           background-color: lightblue;
           border-radius: 10px;
           display: flex;
           align-items: center;
           justify-content: space-around;
       }

       .box {
           height: 100%;
           display: flex;
           flex-direction: column;
           justify-content: space-around;
       }

       .shopping {
           background-color: orange;
           color: white;
           border-radius: 5px;
           height: 40px;
           width: 100px;
           display: flex;
           justify-content: center;
           align-items: center;
       }

       .btn:hover{
           color: red;
           cursor: pointer;
       }

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

好帮手慕码

2019-05-30

同学你好!

代码效果实现的是可以的哦~

按照效果图,可优化:

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

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

如果帮助到了你 欢迎采纳 祝学习愉快~

0

0 学习 · 6815 问题

查看课程