老师 帮忙检查一下可以吗?

来源:3-13 编程练习

aleeeeex

2018-12-18 12:54:15

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title></title>
    <style>
      /*在此处补充代码*/
      header{
          width:100%;
          background:#000;
          display:flex;
          flex-direction:row;
          flex-wrap:nowrap;
          justify-content:space-around;
          align-items:center;
      }
      ul{
         color:#fff;
         list-style:none;
         display:flex;
         flex-direction:row;
         justify-content:space-between;
        
      }
      ul li{
           margin:0 20px;
      }
      .login{
          display:flex;
          flex-direction:row;
          justify-content:space-between;
      }
      input{
          background:orange;
          color:#fff;
          margin:0 10px;
          border:none;
      }
    </style>
</head>
<body>
   <header>
     <div class="logo">
       <img src="http://climg.mukewang.com/59feb59700019dab01910057.png" 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>
</body>
</html>


写回答

1回答

好帮手慕星星

2018-12-18

代码中的问题:

1、建议使用通配符给所有标签清除默认的内外边距:

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

2、左侧logo图片下有缝隙:

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

这是因为图片是inline-block元素,默认存在缝隙,可以给图片设置成block元素。

3、右侧的两个按钮可以设置内边距和圆角,参考:

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

自己动手测试下吧。

祝学习愉快!

0

0 学习 · 5012 问题

查看课程