title: CSS - Add background to some columns in grid
body: <p>Ok, I am new with CSS and this is just causing me trouble. How do I add a background color to multiple columns but not all columns. </p>
  
  <p>I want one background color on span2 and a different color on span10. The problem I run into is issues with padding. When I apply the background to certain columns it won't have a nice even padding around the content. Does this make sense? How do I add a background to certain columns with nested columns and still maintain nice even padding? </p>
  
  <h2>HTML</h2>
  
  <pre><code>&lt;div class="row bg"&gt;
    &lt;div class="span10"&gt; 
  
          &lt;!-- Main hero unit for a primary marketing message or call to action --&gt;
          &lt;div class="sidebar"&gt;
              &lt;div class="hero-unit"&gt;
                  &lt;h1&gt;Join&lt;/h1&gt;
                  &lt;p&gt;This is a template for a simple marketing or informational website. It includes a large callout called the hero unit and three supporting pieces of content. Use it as a starting point to create something more unique.&lt;/p&gt;
                  &lt;p&gt;&lt;a class="btn btn-primary btn-large"&gt;Register Now &amp;raquo;&lt;/a&gt;&lt;/p&gt;
              &lt;/div&gt;
          &lt;/div&gt;
  
          &lt;!-- Example row of columns --&gt;
          &lt;div class="row"&gt;
              &lt;div class="span5"&gt;
                  &lt;div class="bot-pad"&gt;
                      &lt;h2&gt;We are Fun!&lt;/h2&gt;
                      &lt;p&gt;Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. &lt;/p&gt;
                      &lt;p&gt;&lt;a class="btn" href="#"&gt;View details &amp;raquo;&lt;/a&gt;&lt;/p&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
              &lt;div class="span5"&gt;
                  &lt;div class="right-pad bot-pad"&gt;
                      &lt;h2&gt;Learn more about yourself&lt;/h2&gt;
                      &lt;p&gt;Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. &lt;/p&gt;
                      &lt;p&gt;&lt;a class="btn" href="#"&gt;View details &amp;raquo;&lt;/a&gt;&lt;/p&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <h2>CSS</h2>
  
  <pre><code>.bg
  {
      background: url('/assets/img/grid.png');
      .border-radius(5px); //LESS mixin for creating border radius
  }
  .right-pad
  {
      padding-right: 20px;
  }
  
  .bot-pad
  {
      padding-bottom: 20px;
  }
  </code></pre>
  
  <h2>Explanation</h2>
  
  <p>So the <code>bg</code> class is applying the background. Then my nested columns have weird padding, so I went through and added classes like <code>right-pad</code> to the columns that need right padding and <code>bot-pad</code> to columns that need padding on the bottom. I know how incredibly wrong this is semantically, I just don't know how else to get my needed results. Thanks.</p>
  
  <p>Here is another example of what I am trying to do... however they do not provide a solution either
  <a href="https://github.com/twitter/bootstrap/issues/1446" rel="noreferrer">https://github.com/twitter/bootstrap/issues/1446</a></p>