title: Using :before/:after Selectors to add Margins Around Elements
body: <p>I implemented (a modified version of) Gene Locklin's 'depth' which works just fine, here's the code:</p>
  
  <pre><code>body:before {
      height: 10px;
      width: 110%;
      position: fixed;
      top: -10px;
      left: -10px;
      z-index: 6;
      -webkit-box-shadow: 0px 0px 10px rgba(0,0,0,0.8);
      -moz-box-shadow: 0px 0px 10px rgba(0,0,0,0.8);
      box-shadow: 0px 0px 10px rgba(0,0,0,0.8);
      content: "";
  }
  </code></pre>
  
  <p>But I would like to use the :before &amp; :after selectors to add margins or padding, you know some kind of gap, to separate a form from the surrounding text.</p>
  
  <p>This comes after me trying to use these selectors to give some spacing around specific paragraphs, without success I turned to styling these on the basis of their target attributes.</p>
  
  <p>I realize that the selectors were designed primarily to facilite auto-text and that it's perfectly easy to do this with margins or padding (added following queries below),line breaks, spans, an empty division, or even using JavaScript to create an element, and . But I would like to do this with :before &amp; :after.</p>
  
  <p>Here's the example code that I would like to get working:</p>
  
  <pre><code>form:before {
      height: 20px;
      content: "";
  }
  
  form:after {
      height: 20px;
      content: "";
      }
  </code></pre>
  
  <p>Possibilities I think may be preventing this from working... :before/:after need to be displayed as block-level as they are normally inline (but the 'depth' doesn't need this?) and/or :before/:after require absolute positioning.</p>
  
  <p>Thank you in advance for your generous input.</p>