请老师检查作业

来源:2-8 编程练习

Elisha666

2022-05-23 23:24:07

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title></title>
    <style>
      * {
          margin: 0;
          padding: 0;
          box-sizing: border-box;
          list-style: none;
      }
      header {
          background-color: black;
          display: flex;
          justify-content: space-around;
          align-items: center;
          width: 100%;
      }

      .logo {
          width: 100px;
      }

      .nav {
          font-size: 18px;
          color: white;
          display: flex;
          justify-content: space-around;
          width: 800px;
      }

      .login {
          display: flex;
          justify-content: space-between;
          width: 140px;
      }

      input {
          width: 48px;
          height: 30px;
          line-height: 30px;
          border: none;
          color: white;
          border-radius: 4px;
          background-color: rgb(255, 165, 0);
      }
    </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回答

好帮手慕久久

2022-05-24

同学你好,写的不错,有一个地方可以优化:

logo图的父元素宽度设置太小了:

https://img.mukewang.com/climg/628c397909a1bb6704730143.jpg

这样会影响导航中内容的整体排布位置。

建议不设置固定宽度,让其宽度由图片撑开:

https://img.mukewang.com/climg/628c39b309c8fbf604560166.jpg

祝学习愉快!

0

0 学习 · 17877 问题

查看课程