老师这样可以不?

来源:3-17 编程练习

顾文龙

2019-08-01 01:48:43

<!DOCTYPE html>
<html>
<head>
   <meta charset="UTF-8">
   <title></title>
   <style>
       /* 在此处补充代码*/
       *{
           margin: 0;
           padding: 0;
           box-sizing: border-box;
       }
       li{
           list-style: none;
       }
       html{
           height: 100%;
       }
       body{
           min-height: 100%;
       }
       header{
           width: 100%;
           height: 80px;
           display: flex;
           justify-content: space-around;
           align-items: center;
           background-color: #000000;
           color: #ffffff;
       }
       .logo{
           height: 100%;
           width: 15%;
       }
       .logo img{
           display: block;
           height: 100%;
           width: 100%;
        }
       .nav{
           display: flex;
           justify-content: center;
           align-items: center;
           width: 70%;
           height: 100%;
       }
       .nav li{
           flex: 1;
           display: flex;
           justify-content: center;
           align-items: center;
       }
       .login{
           display: flex;
           flex: 1;
           height: 100%;
           justify-content: space-around;
           align-items: center;
       }
       .login input{
           background-color: orange;
           border-radius: 5px;
           border: none;
           font-size: 16px;
           color: white;
           padding: 5px;
       }
       /*    主体内容*/
       section{
           width: 100%;
           height: 40%;
           display: flex;
           justify-content: space-around;
           flex-wrap: wrap;
           align-content: space-around;
       }

       .section{
           width: 40%;
           background: lightblue;
           border-radius: 8px;
           padding: 10px;
           display: flex;
           justify-content: space-around;
           align-items: center;
           margin-top: 8px;
       }

       .btn{
           font-weight: bold;
           background: orange;
           color: #fff;
           padding: 10px;
           border-radius: 10px;
       }

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

好帮手慕码

2019-08-01

同学你好!

代码效果实现可以,根据练习要求可以在按钮上添加hover来实现鼠标悬停按钮文字颜色改变的效果:

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

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

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

0

0 学习 · 6815 问题

查看课程