title: pseudo-elements display: block vs display: inline
body: <p>I am currently practicing CSS by following along with a Youtube tutorial by freecodecamp.org</p>
  <p>My code is as follows:</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>p::before{
    content: "hello ";
    color: white;
    font-size: 60px;
    background: salmon;
    margin-bottom: 20px;
  }
  
  p::after{
    display: block;
    content: "";
    height: 100px;
    width: 100px;
    background: green;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;p&gt;Before and after pseudo elements&lt;/p&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>Now when I specify display: block in the p:: after pseudo-selector I am getting the expected output as follows</p>
  <p><a href="https://i.stack.imgur.com/lEgx5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lEgx5.png" alt="enter image description here" /></a></p>
  <p>but when I omit the display: block property, the green box just disappears as below:</p>
  <p><a href="https://i.stack.imgur.com/JVKPM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JVKPM.png" alt="enter image description here" /></a></p>
  <p>Does someone have an appropriate explanation for why this happens? What I was expecting was that the box will still be shown inline after the 'hello before and after pseudo-elements' but it is disappearing altogether...</p>
  <p>Thanks in Advance for the help.</p>
  <p>Kind Regards,
  Sohaib</p>