title: How to make background image go in the "background" using CSS/HTML
body: <p>I want to fill my page with a background image and have the text aligned in place with that background. With the below code, the background image loads at the top of the page, and the text goes under it. I know I can use the "background: " function, but the way it is done in my below code allows for automatic resizing, regardless of browser size (i.e., mobile devices have small browser sizes). So, I just want the background image to go behind the text.</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  
  &lt;title&gt;Title&lt;/title&gt;    
  
  &lt;style&gt;
  
  img.bg
  {
      min-height: 100%;
      min-width; 781;
  
      width: 100%;
      height: auto;
  
      top: 0;
      left: 0;
  
      z-index: -1;
  }
  
  @media screen and (max-width: 781)
  {
      img.bg
      {
          left: 50%;
          margin-left: -390.5;
      }
  }
  
  #container 
  {
      position: relative;
      width: 781;
      margin: 50 px auto;
      height: 758;
      border: 1px solid black
  }
  
  #left
  {   
      position: relative;
      left: 1.280409731113956%;
      top: 14.51187335092348%;
      padding-top: 10px;
      padding-left: 10px;
      padding-right: 10px;
      width: 50%;
      height: 50%;
      color: #FFFFFF;
      position: relative;
  }   
  
  p
  {
      font: 14px Georgia;
  }
  
  &lt;/style&gt;
  
  &lt;/head&gt;
  </code></pre>
  
  <p>HTML
      </p>
  
  <pre><code>&lt;img class="bg" src="background.jpg"&gt;
  
  &lt;div id="container"&gt;
  
  &lt;div id="left"&gt;
      &lt;p&gt;
      Text
      &lt;/p&gt;
  &lt;/div&gt;
  
  &lt;/div&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>