我的导航栏中的边界线后面有一点空白。您可以将鼠标悬停在导航栏中的元素上来查看它们。它使动画
我放在原地看起来很丑。有什么办法解决这个问题?

<!DOCTYPE html>
<html>
<head>
 <style>
   @keyframes antimouse {
     0% { background-color: #2F9EBD;
       height: 45px}
     100% {
       background-color:#35B1C2;
       height:20px;}
   }

   @keyframes mouse {
     0% { background-color:#35B1C2;
     height:20px}
     100% { background-color: #2F9EBD;
     height: 45px
      }
   }




 ul {
 list-style-type: none;
 margin: 0;
 padding: 0;
   overflow:visible;
   height:48px;
   background-color:#35B1C2;
   text-align: center;
 }
   li{
     text-align: center;
     display: inline-block;
    }


   li a {
     display: inline-block;
     color: white;
     text-align: center;
     padding: 14px 16px;
     text-decoration: none;
   }
   li a {
     animation-fill-mode:forwards;
     animation-duration: 0.5s;
     animation-name: antimouse;
   }

   li a:hover {
       animation-fill-mode:forwards;
       animation-duration: 0.5s;
       animation-name: mouse;
   }

   li {
     border-right: 1px solid #bbb;
   }

   li:last-child {
     border-right: none;
   }

 </style>

 </head>

 <body>
     <ul>
     <li><a href="index.html">Home</a></li>
     <li><a href="aboutme.html">About Me</a></li>
    <li><a href="projects.html">Projects</a></li>

      </ul>

  </body>

</html>

最佳答案

尝试删除li元素之间的换行符,如下所示:

<ul><li><a href="index.html">Home</a></li><li><a href="aboutme.html">About Me</a></li><li><a href="projects.html">Projects</a></li></ul>

关于html - 我的导航栏中的边界线在它们的右侧略有空白,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/43288629/

10-12 02:26