title: How to select the all outer side of a div using after and before property
body: <p>Please see my html code .</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>.new-div{
    width:200px;
    height:200px;
    border:1px solid orange;
    text-align:center;
  }
  
  .new-div::before{
  content: "&amp;nbsp";
  position: absolute;
  top: 0;
  width: 100%;
  z-index: 90;
  background-color: gray;
  left: 0;
  
  }
  .new-div::after{
  content: "&amp;nbsp";
  position: absolute;
  bottom: 0;
  width: 100%;
  z-index: 90;
  background-color: gray;
  left: 0;
  
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code> &lt;div class="new-div"&gt;
    content
   &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>here i want to make all outer side of the new-div with gray color using after and before property. How can i get this. When iam using after and before property i can get the 2 side only .</p>
  
  <p>Please see the below picture  . I want the output like this .</p>
  
  <p><a href="https://i.stack.imgur.com/Fk9BQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Fk9BQ.png" alt="enter image description here"></a></p>