title: add background image using CSS?
body: <p>I am creating a web page and I want to add a background image using CSS. When I added a background image it did not work.</p>
  
  <p>It's in my file directory at folder name Source</p>
  
  <p>css file</p>
  
  <blockquote>
    <p>Source/assets/css/style.css</p>
  </blockquote>
  
  <p>my image at </p>
  
  <blockquote>
    <p>Source/assets/img/header.png</p>
  </blockquote>
  
  <p>and this my html address</p>
  
  <blockquote>
    <p>Source/index.html</p>
  </blockquote>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;div id="container"&gt;
      &lt;div class="mainheader"&gt;
          &lt;nav class="menu"&gt;
              &lt;ul&gt;
                  &lt;li&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;/div&gt;&lt;!-- mainheader--&gt;
  &lt;/div&gt;&lt;!-- container --&gt;
  </code></pre>
  
  <p><strong>CSS</strong></p>
  
  <pre><code>.mainheader {
  margin: 0 auto;
  background:url(assets/img/header.png);
  </code></pre>