title: Fix menu items overlaping header height
body: <p>I want to make my links hover only the available 50px (height: 50px), that are in my header but they are taking more space, what am I doing wrong?</p>
  
  <p><a href="https://i.stack.imgur.com/Qk5Pi.png" rel="nofollow noreferrer">/ Image /</a></p>
  
  <p>Setting padding to 14px in <code>#main-nav ul li a</code> isn't a solution for me. It becomes the exact opposite with less content inside the link.</p>
  
  <p>My HTML document:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
    &lt;meta charset="UTF-8"&gt;
    &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;
    &lt;link rel="stylesheet" href="css/main.css"&gt;
    &lt;title&gt;Document&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;header id="main-header"&gt;
      &lt;nav id="main-nav"&gt;
        &lt;img src="img/logo.png" alt="" class="logo"&gt;
  
        &lt;ul class="main-menu"&gt;
          &lt;li&gt;&lt;a href="#"&gt;Home&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href="#"&gt;About&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href="#"&gt;Services&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href="#"&gt;Blog&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href="#"&gt;Contact&lt;/a&gt;&lt;/li&gt;
        &lt;/ul&gt;
  
        &lt;ul class="right-menu"&gt;
          &lt;li&gt;&lt;a href="#"&gt;EN&lt;/a&gt;&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/nav&gt;
    &lt;/header&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>My CSS:</p>
  
  <pre><code>  * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }
  
  body {
    background: #EEE;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  }
  
  #main-header {
    background-color: #333;
    height: 50px;
    width: 100%;
  }
  
  #main-nav {
    height: 50px;
    width: 90%;
    max-width: 1400px;
    margin: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  #main-nav ul {
    display: flex;
    list-style: none;
  }
  
  #main-nav ul li {
  }
  
  #main-nav ul li a {
    color: #C2C2C2;
    text-decoration: none;
    text-transform: uppercase;
    font-weight: 600;
    padding: 15px;
  }
  
  #main-nav ul li a:hover {
    background-color: #4B4B4B;
    color: #FFF;
  }
  
  #main-nav ul.main-menu {
    flex: 1;
    margin-left: 30px;
  }
  
  .logo {
    width: 70px;
  }
  </code></pre>