title: CSS position:fixed - background-color disappear
body: <p>This is the example : <a href="https://jsfiddle.net/5ahw3tec/" rel="nofollow noreferrer">https://jsfiddle.net/5ahw3tec/</a></p>
  
  <p>HTML</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>html body {
      margin: 0;
      padding: 0;
      -webkit-box-sizing: border-box;
      -moz-box-sizing: border-box;
      box-sizing: border-box;
      text-decoration: none;
      font-family: 'Noto Sans KR', sans-serif;
      list-style: none;
  }
  
      a {
      text-decoration: none;
  }
  
      body {
      background: lightgrey;
      margin: 0;
  }
  
      .container {
      background-color: #ffffff;
      width: 1280px;
      padding: 0;
  }
  
      #gnb {
      width: 1280px;
      height: 80px;
      z-index: 100;
      position: fixed;
  }
  
      #gnb .header-area img {
      position: relative;
      top: 25px;
      left: 80px;
  }
  
      #gnb .header-area nav {
      position: relative;
      width: 930px;
      left: 280px;
  }
  
      #gnb .header-area ul {
      list-style: none;
      display: flex;
      padding: 0;
  }
  
      #gnb .header-area li {
      margin-left: 80px;
  }
  
      #gnb .header-area li a {
      color: #333333;
  }
  
      #gnb .header-area li:nth-of-type(1) {
      margin-left: 0;
  }
  
      #gnb .header-area li a:hover {
      color: #18d28b;
      text-decoration: none;
  }
  
      main {
      width: 100%;
      height: 800px;
      background: pink;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="container"&gt;
    &lt;header id="gnb"&gt;
      &lt;div class="header-area"&gt;
      &lt;a href="#"&gt;
        &lt;img src="somelogo" alt=""&gt;
      &lt;/a&gt;
      &lt;nav&gt;
        &lt;ul&gt;
          &lt;li&gt;&lt;a href="#"&gt;HELLO&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href="#"&gt;HELLO&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href="#"&gt;HELLO&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href="#"&gt;HELLO&lt;/a&gt;&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/nav&gt;
    &lt;/div&gt;
  &lt;/header&gt;
  
  &lt;main&gt;
  
  &lt;/main&gt;
  
  &lt;footer&gt;
  
  &lt;/footer&gt;
   &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>CSS</p>
  
  <p>When I scroll down, the fixed menu bar(logo image and some lists) is located in the top of the page.</p>
  
  <p>But, there is an issue. 
  When I apply position:fixed to #gnb (in the example above), 
  the background color(white) that I made earlier is disappeared. I don't know what the problem is exactly..</p>
  
  <p>I want to keep the effect of background color too.</p>
  
  <ul>
  <li>I am applying Bootstrap for container class, but not for the menu bar.</li>
  </ul>