想问下为啥按钮没有居中

来源:5-2 编程练习

qq_我永远喜欢小奈布_0

2018-08-25 14:10:48

<!DOCTYPE html>

<html>

<head>

    <meta charset="UTF-8">

    <title></title>

    <style>

     /* 在此处补充代码*/

      li{

          list-style:none;

      }

      header{

          background:#000;

          color:#fff;

          display:flex;

          justify-content:space-around;

      }

      .nav{

          width:400px;

          display:flex;

           justify-content:space-around;

           align-items:center;

      }

      .login{

          width:150px;

          display:flex;

          justify-content:space-around;

          align-items:center;

      }

      section{

          display:flex;

          justify-content:space-around;

          margin:20px 0;

      }

      .section{

          width:400px;

          height:150px;

          background:#87CEFA;

          display:flex; 

          justify-content: space-around;

      }

      .box{

          display:flex;

          flex-direction:column;

          justify-content:center; 

      }

      .shopping{

          background:#FF8C00;

          color:#fff;

          display:flex;

          align-items:center;

      }

      .btn:hover{

        background:#fff;

        color:#FF8C00;

      }

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

    </section>

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

    </section> 

</body>

</html>


写回答

1回答

好帮手慕星星

2018-08-27

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

现在是居中显示的呢。自己测试出来是什么样的呢,可以粘贴一下图片哦。整体效果还是不错的。祝学习愉快~~

0

0 学习 · 5012 问题

查看课程